Skip to main content

Conveniences for working in Jupyter Notebook or Ipython

Project description

Epic jupyter — Conveniences for working in Jupyter Notebook or Ipython

Epic-jupyter CI

What is it?

The epic-jupyter Python library provides several utilities tailored to run under Jupyter environments, and to help in writing libraries that adapt nicely to the environment they run in and its capabilities.

Main modules

epic.jupyter.ipython

Allows safe discovery of the current environment.

  • get_ipython() gets the IPython manager if it is available
  • is_ipython() tells you whether you're in an IPython-based environment
  • is_jupyter_notebook() tells you specifically whether you're running in a Jupyter kernel

epic.jupyter.display

Provides functions related to displaying content.

  • display_if_ipython(...) allows for safe displaying of objects, with optional graceful degradation to printing
  • markdown("# hey!") displays preformatted markdown content
  • side_by_side(...) displays arbitrary objects in a side-by-side table (and also in one-after-the-other columns)

epic.jupyter.initialization

Provides the function event_register_once(event, callback, ...) which registers an IPython event and removes it after it has triggered for the first time. This is intended to trigger initialization of internal structures upon some first time event.

epic.jupyter.interpolate

Provides the IPython magic %interpolate line and cell magic. This magic is a debug helper: use it to simulate IPython's variable interpolation mechanism and review the results.

Load this extension by calling %loadext epic.jupyter.interpolate.

You can also load this and all future extenstions by calling %loadext epic.jupyter.

epic.jupyter.nbcode

Use the function use_notebook_code('path/to/source.py') to start working with "notebook code" files.

Notebook code files are python files that are loaded and then reloaded (using exec) whenever they change.

These files should help maintaining separation of concerns. When a significant amount of relatively generic code is developed for the purposes of a notebook, keeping it in an adjacent file keeps the notebook itself focused on the research narrative. The automatic reload mechanism in turn frees the user from having to go back and run random code cells whenever some change is made to the underlying code.

Ultimately, any useful code should make its way into a general purpose library. During that time when its scope is limited to a specific notebook - notebook code files are here for you.

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

epic-jupyter-1.0.5.zip (35.4 kB view details)

Uploaded Source

File details

Details for the file epic-jupyter-1.0.5.zip.

File metadata

  • Download URL: epic-jupyter-1.0.5.zip
  • Upload date:
  • Size: 35.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for epic-jupyter-1.0.5.zip
Algorithm Hash digest
SHA256 da16bd54f090759f8b17e6bf85e45ede38fc6a282f729ee85ef3b2aa59359d87
MD5 1cfb5120cd7d5b207bf418ee4cb3e085
BLAKE2b-256 fc41a5b59617851d520044126737dcc28af012b2c8120257fd7d5d57b289f5fa

See more details on using hashes here.

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