requirements.txt extractor: turn a Jupyter notebook into pip dependencies in seconds
This extractor reads a .ipynb, scans code cells for imports and shell-magic install lines, and writes a requirements.txt you can hand to pip install -r. Someone shared a notebook, you want to run it locally, and you do not have time to collect imports by hand. The notebook is processed for this request only and is not stored afterward.
Pure Python parsers tend to miss a few things. The extractor handles import x, import a, b, import a as b, from x.y import z, and shell magics like !pip install pandas, %pip install requests==2.31, and !conda install -y numpy. Standard-library modules drop out so you do not pin os or json by mistake. The well-known import-name aliases, cv2 to opencv-python, sklearn to scikit-learn, PIL to Pillow, bs4 to beautifulsoup4, yaml to PyYAML, dotenv to python-dotenv, map to their real PyPI names so pip install -r actually works.
Compared to running pipreqs locally, this page is faster when you only have one notebook to inspect, when the project is not on disk yet, or when you want to share a starter requirements.txt with a teammate before you create a virtual environment. It is also a useful sanity check after pipreqs: drop the same notebook here, eyeball the list, and adjust pins before you push.
The defaults give you a list pinned only where the notebook itself pinned things (via !pip install pandas==2.2.1). Turn off Map import names if you would rather see the raw module names. Turn off Sort to keep the order in which the imports appear. Turn off Header to skip the comment block at the top when you want a strict, machine-readable file.

