Generating PDF Reports Programmatically in Python Using API Data

Malcolm Kapuza
Apr 9, 2019 · 2 min read

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) 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.

Image for post
Image for post

Jupyter Notebook

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


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

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store