Data Pipelines with Python and PostgreSQL



Data Pipelines with Python and PostgreSQL

Data Pipelines with Python and PostgreSQL

Code : https://github.com/Sean-Bradley/Stream-Data-From-Flask-To-Postgres
I show how to use streaming techniques to build a data pipeline which pulls data from an external API that returns massive amounts of data, and insert it straight into a PostgreSQL data base ASAP.
The Python process that reads the huge amount of data, before inserting into Postgres is able to process the incoming chunks by use of the stream=True option on the Requests module, and the iter_content method of the Request response. The mock 3rd party API, which hosts the potentially petabytes of data, makes use of the Flask stream_with_context method.

Comments are closed.