Integrate code from Jupyter Notebooks directly into Python projects while retaining native GitHub rendering.
Project description
EasyJupyter
🚧🚧🚧🚧🚧🚧🚧🚧 ‼️ Library not ready yet! 🚧🚧🚧🚧🚧🚧🚧🚧
⭐️ #TODO fix this wording, has to be a better way to say this -> This library is designed so that code can be integrated from Jupyter Notebooks into Python projects or other Notebooks, or just work with notebooks that you want to be displayed as notebooks.
Benefits:
- Native GitHub Rendering: Keep your code in notebooks so plots and markdown render natively on GitHub.
- Zero Clutter: Generated cache files are stored in a hidden
.easyJupyter_cachedirectory, keeping your workspace clean. - Custom ignore syntax to ignore exploratory cells, or lines of code.
Ignore Notebook Commands
Use these commands inside your notebooks to control what gets compiled into the cache file.
- Markdown Cells: Ignored by default.
- Ignore An Entire Cell:
- Add
# @i-cto the very top of the cell.
- Add
- Ignore One Line In A Cell:
- Add
# @i-labove the line you want to ignore.
- Add
Getting Started
Installation & Initial Sync
First, install the library, then run the sync command to generate the cache files for any existing notebooks.
pip install easyjupyter
easyjupyter --sync
Usage
🚨 In your project's entry point (eg., main.py), or in a notebook (if its importing code from another notebook or a script), import the library at the very top of the file:
import EasyJupyter
from my_notebook import Class, Function_name
How It Works: The moment EasyJupyter is imported, it spawns a detached background daemon watcher. Every time you save a notebook, the daemon instantly updates the corresponding hidden cache file.
Arguments
Cache Cleanup
-
If you rename, move, or delete a notebook, the old cache file will remain in the hidden cache directory. To clean up the cache, run:
easyjupyter --clean
Watch Daemon Logs
-
If you incorrectly use EasyJupyter in a notebook (e.g., redundant ignore comments), warnings will be added to the cache file of the notebook, so that when you run your program as a whole, the warnings are printed to the console. However, if you are only using notebooks you wont be able to see these warnings, so to view the active warning logs, run:
easyjupyter --watch
VSC Pylance Intellisense Setup
VS Code's Pylance intellisense will not work with notebooks, or the hidden cache files generated for the notebooks. But you can tell it where to look for the cache files. Run one of the following commands in the root of your project:
-
If you don't have a
.vscode/settings.jsonfile yet, run:mkdir -p .vscode && echo '{ "python.analysis.extraPaths": [ "./.easyJupyter_cache" ] }' > .vscode/settings.json
-
If you already have a
.vscode/settings.jsonfile, add the following to it:{ "python.analysis.extraPaths": [ "./.easyJupyter_cache" ] }
Other
If any issues occur with the watcher daemon, manually run it with: python -m EasyJupyter.watcher (note that this only spawns the daemon in the foreground), or check the logs in .easyJupyter_cache/watcher.log.
Not For You
- Dev Notes:
-
When updating the daemon, we need to clear the old cache and restart the daemon.
pkill -f EasyJupyter.watcher rm -rf .easyJupyter_cache easyjupyter --sync
-
Install locally:
pip install -e . -
Distributing (requirements, build and twine):
- Build the dist with
python -m build - Publish to PYPI (pip) with
twine upload dist/*
- Build the dist with
-
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file easyjupyter-0.1.0.tar.gz.
File metadata
- Download URL: easyjupyter-0.1.0.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2048c0bd3864499f517adc96c2486575d5876bebc6dc58b700cdd46c2b0a06d4
|
|
| MD5 |
2556e12a6b6a79d49ddf74cf49b92457
|
|
| BLAKE2b-256 |
dc53346f344f51112fce2f483bdf78c4f932fd9c7d602b7affdb4c30d43b95a9
|
File details
Details for the file easyjupyter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: easyjupyter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce74ee0dcde37afaec00a4d8ff07efa828b54ca3a985e13045c1171817cd4e6f
|
|
| MD5 |
e14646a6c2b38bb4d5cd6b1c8fff30a4
|
|
| BLAKE2b-256 |
3ea4e18b5b1b8579f1a19b8a3357fa78bd3f3005c7d1f123ccf7a2089ae562b1
|