Skip to main content

Dumps marked code cells from a Jupyter notebook into a text file.

Project description

Dumps marked code cells from a Jupyter notebook into a text file.

Features

  • Reads a Jupyter Notebook and export marked code cells with the comment #~ to a single .py file.

  • Exports cells marked with custom comments.

  • Exports a list of cells into a single file (useful to export markdown cells as a README.md file)

Dependencies

None

Usage

import nb2py
nb2py.dump('NB2PY_SOURCE.ipynb','nb2py.py')
nb2py.dump_indices('NB2PY_SOURCE.ipynb','README.md',[3,2])

Notes: check that you saved your notebook before you use dump to see the changes!

For examples, check the tutorial.

Credits

Created by Hugo Guillen, 2017.

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

nb2py-0.1.6.tar.gz (2.0 kB view details)

Uploaded Source

File details

Details for the file nb2py-0.1.6.tar.gz.

File metadata

  • Download URL: nb2py-0.1.6.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for nb2py-0.1.6.tar.gz
Algorithm Hash digest
SHA256 ee27970148d1ab58143c59bb41d1b0cc02072fe07302c9ea46e7a4294f700479
MD5 1f1942b13d5f48edfe42f6c6d4a5f911
BLAKE2b-256 159a558bf83a5844c9782b3a7c0b70100d456d957e946c78c3e6d892dcb7ad71

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