Generating PDF Reports Programmatically in Python Using API Data

The following was written by CTO Malcolm Kapuza, who dives into some example code showing how to use the Capital Finder API to create the alternative finance directories we put out on a regular basis.

In this blog we’re going to walk through how we generate our alternative finance directories programmatically. If you are not familiar with these, you can check out our reports page or view our latest directory on cryptocurrencies in emerging markets here. These directories use our Capital Finder API as a data source, but present it in a visually appealing, digestible, and shareable way. This has been very useful in allowing our clients to understand the kind of data that we have, without having to query our API directly.

These directories have been very popular and proven to be a great way to share our data. If you are reading this, you may be sitting on a lot of valuable data, but struggling for a way to engage your audience. Reports are a concise and aesthetic way to do this.

Your data will undoubtedly be different from ours. However, we hope that this tutorial demystifies the process and gives you ideas for how you can use this process within your own organization to create visually appealing reports and engage your audience.

I have embedded a Jupyter notebook below to better narrate the explanation. Please have a look at the following example directory, generated from the code, here before reading the notebook, as it will make following along much easier. Also, you can find the HTML used to template the report at the bottom of the page.

If you are interested in trying this notebook out using our data, please email us at capital.finder (at) alliedcrowds.com and we will supply you a temporary key that will allow you to generate your own unique directories for use within your organization.

Report Table Screenshot

The following table is referenced in the Jupyter Notebook below.

Crowdfunding Country Table

Figure 1: Example output for semi-active and active country table

Jupyter Notebook

This Jupyter Notebook details how to Generate PDF reports programmatically in Python using our Capital Finder API.

report_template.html

This gist contains the HTML used for templating the report generated in this blog.