githubocto/flat-demo-bitcoin-price

post processing script in python

Closed this issue · 3 comments

Query: Can we have a post-process execution script in python?

Hi there! The wonderful @pierrotsmnrd has created an example that does just that here: https://github.com/pierrotsmnrd/flat_data_py_example.

The gist of it is that you can:

  1. Use a Deno postprocessing file to install python libraries
  2. Use that same Deno postprocesing file to then execute the python script

Copying from his code:

import 'https://deno.land/x/flat@0.0.10/mod.ts'

// install requirements with pip
const pip_install = Deno.run({
    cmd: ['python', '-m', 'pip', 'install', '-r', 'requirements.txt'],
});
await pip_install.status();

// Forwards the execution to the python script
const py_run = Deno.run({
    cmd: ['python', './postprocessing.py'].concat(Deno.args),
});
await py_run.status();

Feel free to reopen if you have further questions.

Wow, Thanks That's what I was looking for. :) Thanks @pierrotsmnrd @irealva

https://github.com/misalraj/flat-demo-share-pricerd