Skip to main content

jupyter-cache

Github-CI Coverage Status Documentation Status Code style: black PyPI

A defined interface for working with a cache of jupyter notebooks.

Why use jupyter-cache?

If you have a number of notebooks whose execution outputs you want to ensure are kept up to date, without having to re-execute them every time (particularly for long running code, or text-based formats that do not store the outputs).

The notebooks must have deterministic execution outputs:

  • You use the same environment to run them (e.g. the same installed packages)
  • They run no non-deterministic code (e.g. random numbers)
  • They do not depend on external resources (e.g. files or network connections) that change over time

For example, it is utilised by jupyter-book, to allow for fast document re-builds.

Install

pip install jupyter-cache

For development:

git clone https://github.com/executablebooks/jupyter-cache
cd jupyter-cache
git checkout develop
pip install -e .[cli,code_style,testing]

See the documentation for usage.

Development

Some desired requirements (not yet all implemented):

  • Persistent
  • Separates out "edits to content" from "edits to code cells". Cell rearranges and code cell changes should require a re-execution. Content changes should not.
  • Allow parallel access to notebooks (for execution)
  • Store execution statistics/reports
  • Store external assets: Notebooks being executed often require external assets: importing scripts/data/etc. These are prepared by the users.
  • Store execution artefacts: created during execution
  • A transparent and robust cache invalidation: imagine the user updating an external dependency or a Python module, or checking out a different git branch.

Contributing

jupyter-cache follows the Executable Book Contribution Guide. We'd love your help!

Code Style

Code style is tested using flake8, with the configuration set in .flake8, and code formatted with black.

Installing with jupyter-cache[code_style] makes the pre-commit package available, which will ensure this style is met before commits are submitted, by reformatting the code and testing for lint errors. It can be setup by:

>> cd jupyter-cache
>> pre-commit install

Optionally you can run black and flake8 separately:

>> black .
>> flake8 .

Editors like VS Code also have automatic code reformat utilities, which can adhere to this standard.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyter-cache-0.6.0.tar.gz (31.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jupyter_cache-0.6.0-py3-none-any.whl (33.8 kB view details)

Uploaded Python 3

File details

Details for the file jupyter-cache-0.6.0.tar.gz.

File metadata

  • Download URL: jupyter-cache-0.6.0.tar.gz
  • Upload date:
  • Size: 31.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.2

File hashes

Hashes for jupyter-cache-0.6.0.tar.gz
Algorithm Hash digest
SHA256 4f6ef31f992cfee6f0efc7ce070267f5ab57fe3ad7e39566d4f1a9719b005e35
MD5 b3c3a361bd243008b3df96b6aaff083f
BLAKE2b-256 ba02e12305125a66b6e825c65457be459d923f73752fe5d398e42d28f55e8c63

See more details on using hashes here.

File details

Details for the file jupyter_cache-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: jupyter_cache-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 33.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.2

File hashes

Hashes for jupyter_cache-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 21b189627a0942e552a17795475520c5ee22667af92f2f6b811bf599349f86a1
MD5 b5d8acc7c770cd19f5fe3a0a474c216d
BLAKE2b-256 18af38ad2dd6bf4ee38b2d86383450d53b0d09ab1436c75fd899fabcef74ebc0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page