post processing script in python
Closed this issue · 3 comments
misalraj commented
Query: Can we have a post-process execution script in python?
irealva commented
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:
- Use a Deno postprocessing file to install python libraries
- 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();
irealva commented
Feel free to reopen if you have further questions.
misalraj commented
Wow, Thanks That's what I was looking for. :) Thanks @pierrotsmnrd @irealva