EasyJupyter allows you to seamlessly integrate your Jupyter Notebook code into Python projects or other notebooks. It transforms your notebooks into reusable modules, enabling you to leverage their interactive development environment while maintaining their native display for documentation and collaboration.
Project description
EasyJupyter
EasyJupyter allows you to seamlessly integrate your Jupyter Notebook code into Python projects or other notebooks. It transforms your notebooks into reusable modules, enabling you to leverage their interactive development environment while maintaining their native display for documentation and collaboration.
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 (e.g., main.py), or in a notebook, import the library at the very top of the file:
import EasyJupyter
from my_notebook import Class, Function_name
How It Works: When EasyJupyter is first imported and run, it initiates a single, detached background daemon. This daemon then continuously monitors your notebooks, instantly updating their hidden cache files every time you save. This design ensures efficient resource use, as only one daemon operates at a time. If the daemon is not already running (e.g., after a system restart or a period of inactivity), a new one will be automatically started when EasyJupyter is imported again.
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 to PyPI:
-
Releases are automated via GitHub Actions (CI/CD). To publish a new release, tag a commit with the new version number (e.g.,
git tag 0.1.2andgit push --tags), or do it in Github Desktop. -
Note: If you make any changes to
pyproject.toml(like adding dependencies), you must runpoetry lockand commit the updatedpoetry.lockfile before tagging the release, otherwise the automated build will fail! -
Testing Releases Locally (on TestPyPI):
- First-Time Setup:
- Create an API token on TestPyPI. Note: https://pypi.org/ and https://test.pypi.org/ are not the same, have a different login for each!
- Configure Poetry with the repository URL and your token:
# 1. Tell Poetry where TestPyPI is poetry config repositories.testpypi https://test.pypi.org/legacy/ # 2. Provide your token for authentication poetry config pypi-token.testpypi <paste-your-testpypi-token-here>
- Before Each Test Release:
- Ensure your
poetry.lockis up-to-date:poetry lock - Check for errors:
poetry check - Build the package:
poetry build
- Ensure your
- Publish to TestPyPI:
poetry publish -r testpypi
- First-Time Setup:
-
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.3.tar.gz.
File metadata
- Download URL: easyjupyter-0.1.3.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae00a55f50c7dad4ac8a0f419e8328b5f093302436d2e0055fd1d236a2ac27ab
|
|
| MD5 |
82f3a9ceb1c112ecd7c536857d9f4bb2
|
|
| BLAKE2b-256 |
d4ca5377edcb56af5de167f2d8f508881a85433221ce14cc0e6fe013e735e792
|
Provenance
The following attestation bundles were made for easyjupyter-0.1.3.tar.gz:
Publisher:
release.yaml on t20e/EasyJupyter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easyjupyter-0.1.3.tar.gz -
Subject digest:
ae00a55f50c7dad4ac8a0f419e8328b5f093302436d2e0055fd1d236a2ac27ab - Sigstore transparency entry: 1245074011
- Sigstore integration time:
-
Permalink:
t20e/EasyJupyter@b0141ff925834a36ec7ae2e0fec6d2c1029da262 -
Branch / Tag:
refs/tags/0.1.3 - Owner: https://github.com/t20e
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@b0141ff925834a36ec7ae2e0fec6d2c1029da262 -
Trigger Event:
push
-
Statement type:
File details
Details for the file easyjupyter-0.1.3-py3-none-any.whl.
File metadata
- Download URL: easyjupyter-0.1.3-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
728ad2d0abec89079a7c3398db1ec5902fb6eee77bd086393a70fc6084bf252c
|
|
| MD5 |
e9b087e5e44f0610ae86894df1130b0c
|
|
| BLAKE2b-256 |
f1075c64804fe75767c9d37ae471ca3e5fa0c47f3fa93fd838110d491bbea32c
|
Provenance
The following attestation bundles were made for easyjupyter-0.1.3-py3-none-any.whl:
Publisher:
release.yaml on t20e/EasyJupyter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easyjupyter-0.1.3-py3-none-any.whl -
Subject digest:
728ad2d0abec89079a7c3398db1ec5902fb6eee77bd086393a70fc6084bf252c - Sigstore transparency entry: 1245074015
- Sigstore integration time:
-
Permalink:
t20e/EasyJupyter@b0141ff925834a36ec7ae2e0fec6d2c1029da262 -
Branch / Tag:
refs/tags/0.1.3 - Owner: https://github.com/t20e
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@b0141ff925834a36ec7ae2e0fec6d2c1029da262 -
Trigger Event:
push
-
Statement type: