A simple command-line tool for extracting code cells from Jupyter notebooks. Optionally, it allows extraction of all cell types including markdown.
For those contributing and making changes to the codebase, it's often more efficient to install the package in 'editable' mode. This way, changes you make to the source immediately reflect in the installed package.
To install in editable mode:
python setup.py develop
This will set up a link to your source code, so you won't have to repackage and reinstall every time you make a change.
- Clean the
dist
directory to prevent old distributions:
rm -r dist/*
- Package the project:
python setup.py sdist bdist_wheel
- Install the packaged distribution (Note: the version might depend on what is set in
setup.py
):
pip install --upgrade dist/jupyter-code-extractor-0.1.tar.gz
After installation, you can run the jupyter-code-extractor
directly from the CLI.
To extract all cell types, use the --all-cells
option:
jupyter-code-extractor --all-cells your_notebook.ipynb
Without the --all-cells
option, only code cells will be extracted.
- Python 3.x
- Other dependencies can be found in the
requirements.txt
file.
For contributions, please create a fork, make your changes, and submit a pull request. Details on the development setup and guidelines can be found in the CONTRIBUTING.md file.
Once pull requests are approved and merged, maintainers will handle versioning and releases. New releases on GitHub will automatically trigger package updates on PyPI via GitHub Actions.
This project is licensed under the MIT License. See the LICENSE file for more details.
For a detailed history of changes, see CHANGELOG.md.
- 0.1 - Initial release with basic features.
- 0.2 - ... (and so on for a few recent versions)
For any issues or contributions, please open an issue or pull request.