Skip to main content

IPython Notebook code reuse

Project description

IPython notebook are great for development and visualzing data, however, in terms of code sharing and reusing they’re quite bad.

If you want to reuse your notebook as a program or import functionality into other modules, you have a problem. Yes, you can move your code into a separate module but then you loose then notebook interface and the ability to change it.

This package contains several utilities to reuse the code in your notebook without the need to export/convert it everytime.

To import a notebook into another module do the following:

import ipnb.importer import my_notebook

my_notebook.some_cool_method()

You can also run a notebook directly from the command line:

python -m ipnb.run /path/to/my_notebook.ipynb

Optionally specify ‘-s’ to print the source code to stderr before execution starts and ‘-d’ to debug the notebook. Currently the implementation will try to use PuDB and fallback to pdb

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

ipnb-0.1.0.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file ipnb-0.1.0.tar.gz.

File metadata

  • Download URL: ipnb-0.1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ipnb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 00e14c1fb09f0e5b87a4af470b2a3ff0bcec7c3d28f78cb807453c1e5b220760
MD5 300d31d1ff37d6f37707c0dbc72bda9f
BLAKE2b-256 97da738b5f7578361763219bded42119bd0ae36fa4c5435330a424a4cba92ef3

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