Create a package from a jupyter notebook
A tiny little package to create packages from jupyter notebooks
If you find yourself copy pasting functions between jupyter notebooks, this might help.
Typical Use Cases
This is very helpful when producing the same graph, running the same ETL, or executing the same ML pipeline on different datasets or different versions of the same dataset.
Make Packages from Jupyter Notebooks
You can run this in <your_notebook.ipynb> or anywhere else in the same directory
will create the needed files and directories [in the current directory] to produce a local package, which you can access by
cleaned_notebook_name is all lower case and has spaces replaced with underscores. Please note if your notebook name has illegal characters for a python package, there will be an error.
I recommend importing your notebook
as an abbreviation.
Make sure to rerun the code if you want the package updated.
From the Command Line
Under the Hood: Package Directory Structure
With no consensus on directory structure for packages, I defaulted to a version of python.org's suggestion.
notebooks/ ├── src/ │ └── <notebook_name>/ │ ├── __init__.py │ └── <notebook_name>.py # what you'll be importing ├── bin/ │ └── <notebook_name>.py #executable
I realize the import statement is hefty, but I didn't want to handle collissions in a VO.
Aything you don't want included in the package you can put below a MARKDOWN cell including the text between the quotes
"# DO NOT ADD BELOW TO SCRIPT"
Help! My code isn't updating!
Make sure that you've run your notebook and saved it. This package relies on jupyter notebook's
nbconvert under the hood, which looks to the most recent checkpoint of your notebook.
Help! Why can't jupyckage do more?!?!
If you're interested added functionality, please let me know and I'll look at adding it or happily work with you so you can contribute :)
Hi, I'm Kerstin Frailey. I whipped up this package quickly to make my life a bit easier. Hope it helps some other people out, too.
Here's my contact info:
- twitter @KEFrailey
- blog datascienceatwork.blog
- email firstname.lastname@example.org
- linkedin linkedin.com/in/kefrailey
Hope you have a nice day!
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for jupyckage-0.0.2-py3-none-any.whl