Skip to main content

EasyJupyter

EasyJupyter allows you to effortlessly integrate your Jupyter Notebook code into any Python project or other notebooks. It intelligently transforms your notebooks into standard Python modules, allowing you to import functions, classes, and variables as if they were regular .py files. This seamless process, managed by a background caching mechanism, lets you leverage the interactive development environment of notebooks for rapid prototyping and analysis, while ensuring your code is modular and reusable.

This is particularly useful for AI/Data science projects. For example, if you are building out a Transformer architecture, you could code and write notes for each layer of the model in its own notebook, and then seamlessly import them into your main project or another notebook.

Key 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_cache directory, keeping your workspace clean.
  • Custom ignore syntax to ignore exploratory cells, or lines of code.

How It Works: When EasyJupyter is first imported within a project, it initiates a single, detached background daemon for that specific project. This daemon is tied to your project's root (specifically, a generated .easyJupyter_cache/watcher.pid file) and monitors only the notebooks within it. This per-project design ensures that different projects can have their own daemons completely isolated and do not interfere with each other. If the daemon for a project is not already running, it will be started automatically the next time you import EasyJupyter within that project's environment. The daemon's only job is to detect saves in the notebooks and update the cache files.

Table of Contents

Ignore Notebook Commands

Use these commands inside notebooks to control what gets compiled into the cache.

  • Markdown Cells: Ignored by default.
  • Ignore An Entire Cell:
    • Add # @i-c to the very top of the cell.
  • Ignore One Line In A Cell:
    • Add # @i-l above the line you want to ignore.

Getting Started

Installation

pip install easyjupyter

Usage

In your project's entry point (e.g., main.py) and in any Jupyter Notebooks where you want the daemon to be active or when importing from other notebooks, import the library at the very top of the file:

import easyjupyter # Import at the very top of the file
from my_notebook import Class, Function_name
  • Importing EasyJupyter in many files is not a problem, as only one daemon can run at a time per project, you could import it in all your files if you want.

[!important] ⭐️ Never edit the cache files directly, only edit the notebooks!

⭐️ If your project has nested folders, and does contain a .git or pyproject.toml. Create a .easyJupyterConfig file in the root of your project, run:

# cd into your project root
touch .easyJupyterConfig 
echo "EasyJupyter: The file tells the daemon that this directory is the root of your project." > .easyJupyterConfig

[!NOTE]

  • You should use Notebook automatic reloading if you are simultaneously working with many notebooks that import each other. Add the following to a cell at the top of notebooks!

    # @i-c
    %load_ext autoreload
    %autoreload 2
    
  • Examples:

    • example_nested_project. Note run main.py from inside ./example_nested_project, also for VSC's Pylance to kick in, open a new VSC window with ./example_nested_project as root, and follow VSC Pylance Intellisense Setup below.
    • A larger project example

Arguments

  • Always run easyjupyter --<argument> from somewhere in a project, where the daemon lives.

Sync All Notebooks

  • To sync all notebooks to the cache, run:
    • This is not necessary for every time you update a notebook!

    • When sharing code with others like a Git repo, you don't have to commit the .easyJupyter_cache folder. Instead, instruct the user to run:

      easyjupyter --sync 
      
    • Or, if you want to forcefully rebuild all cache files by bypassing the timestamp freshness check, run:

      easyjupyter --sync --force
      

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 embedded directly into the generated cache file. These warnings will be printed to the console (or notebook output) whenever the cached module is imported and executed, even when importing from another notebook. However, if you want to view the live warnings as the daemon runs, run:

    easyjupyter --watch
    

Stop Daemon

  • The daemon process will terminate by itself, however, if you need to gracefully stop the background daemon process, run:

    easyjupyter --stop
    # Or hard stop: `pkill -f easyjupyter.watcher`
    

VSC Pylance Intellisense Setup

VS Code's Pylance intellisense will not natively 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:

  1. If you don't have a .vscode/settings.json file yet, run:

    mkdir -p .vscode && echo '{
        "python.analysis.extraPaths": [
            "./.easyJupyter_cache"
        ],
        "search.exclude": { // Excludes the cache directory from VSC search
            "**/.easyJupyter_cache/**": true
        }
    }' > .vscode/settings.json
    
  2. If you already have a .vscode/settings.json file, add the following inside the {} brackets:

    "python.analysis.extraPaths": [
        "./.easyJupyter_cache"
    ],
    "search.exclude": { // Excludes the cache directory from VSC search
        "**/.easyJupyter_cache/**": true
    }
    
  3. Make sure that in VSC you are selecting the environment that has EasyJupyter installed. For notebooks, VSC will prompt you to select the environment when you run a cell in a notebook. For .py files, you can manually select the environment in the bottom right corner of VSC. And you have the VSC window open in the root of your project.

Resolving Errors

If any issues occur with the watcher daemon, manually run it with: python -m easyjupyter.watcher (note that this spawns the daemon in the foreground for debugging). If the daemon is already running in the background, you will need to delete the .easyJupyter_cache/watcher.pid file first.

You can always check the background daemon logs inside .easyJupyter_cache/watcher.log.

FAQ:

  • Import Issues:
    • Did you add the .easyJupyterConfig file to the root of your project?
    • Did you name the notebook with a - instead of a _?
    • Did you add EasyJupyter to the notebook to be imported and run it?
  • Errors:
    • Did you forget to use ignore syntax in the notebook that you are trying to import?
  • For VSC intellisense, did you add the extraPaths to your settings.json
  • If AI coding assistants are suggesting edits in the hidden cache files, add .easyJupyter_cache/ to that AI's config ignore files e.g., .cursorignore, .geminiignore, .aiexclude...

Release files for EasyJupyter 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for EasyJupyter 0.2.1
File Size Uploaded
easyjupyter-0.2.1.tar.gz 16.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for EasyJupyter 0.2.1
File Interpreter ABI Platform
easyjupyter-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 32.8 kB

Release files / easyjupyter-0.2.1.tar.gz

Download URL easyjupyter-0.2.1.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
34399ca5b03c1cc6a41f667ea09e7345b64773ba41c3e40d72bb8ade6d787f25
BLAKE2b-256 checksum
How to use checksums
c738abed01ec47a0254e42801808b204f4a83c5a8e780ff82f16bb84d200d22b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 16, 2026.

Transparency log

Release files / easyjupyter-0.2.1-py3-none-any.whl

Download URL easyjupyter-0.2.1-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23740fea7a2ee3f6ef7ef9a4982f5d6da7ea747ed821bb0ffcf1b7f7a0072f38
BLAKE2b-256 checksum
How to use checksums
ef96022f893d7869541aa1ce81d1699ed697c6c8f5cf98e864f044edb34ac8b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page