Skip to main content

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

Project description

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.

Project details


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.1.tar.gz (32.0 kB view details)

Uploaded Source

Built Distribution

jupyter_cache-0.6.1-py3-none-any.whl (33.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for jupyter-cache-0.6.1.tar.gz
Algorithm Hash digest
SHA256 26f83901143edf4af2f3ff5a91e2d2ad298e46e2cee03c8071d37a23a63ccbfc
MD5 08954a7059113ad31c60eca382c75f70
BLAKE2b-256 696408dcc1f6fc54a263525edd23b5d2754793470c1c41a8dd82d52406f8d876

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for jupyter_cache-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2fce7d4975805c77f75bdfc1bc2e82bc538b8e5b1af27f2f5e06d55b9f996a82
MD5 7b8e45cdb6ae6cf84cb53eccd82d2e42
BLAKE2b-256 da8e918b115bb3b4b821e2d43315e1a08b909219723191623ffbae9072fd226a

See more details on using hashes here.

Provenance

Supported by

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