flat_data_py_example
flat_data_py_example copied to clipboard
How to use Python in Github's Flat Data
Using python as postprocess script for Github's Flat Data actions
This repository demonstrates how to run a python script as postprocess step for Github's Flat Data actions.
The idea is basic : Use Deno to trigger the execution of a python script.
This example also shows how to install requirements and write a new file.
Execution :
-
the Flat Data action is scheduled daily, and download the BTC prices data (as seen in Github Octo's example) and stores it in
btc-price.json -
the
postprocess.tsscript is then run, triggers the install of python packages, and runs the main python scriptpostprocess.py. it also forwards the arguments. -
postprocess.pyprints out its received arguments, and then generates a dummy output CSV filedf_output.csv, for the sake of the example.
Next steps, ideas and TODOs :
- make an example using conda
Thanks
- Thanks to the Github Octo Team for their friendly advices on Twitter