ploomber / soorgeon

Convert monolithic Jupyter notebooks 📙 into maintainable Ploomber pipelines. 📊
https://ploomber.io
Apache License 2.0
78 stars 20 forks source link

Automatically generating requirements.txt/environment.yml #1

Closed edublancas closed 2 years ago

edublancas commented 2 years ago

Extract the import statements and create a requirements.txt/environment.yml file, but remember that some of them may need editing since the PyPI package may not match the module. We can keep a manually curated list for the most popular ones ( maybe use PyPI API to check which ones do not exist)

we can iterate over imports with:

import parso

tree = parso.parse(code_str)
tree.iter_imports()