Skip to main content

A Python library that parses Jupyter notebook cells

Project description

jupyter-notebook-parser

A Python library to parse cell contents from Jupyter notebooks

Installation

pip install jupyter-notebook-parser

Usage

from jupyter_notebook_parser import JupyterNotebookParser

parser = JupyterNotebookParser('my_notebook.ipynb')

parser.get_all_cells()  # returns List[Dict], each Dict is a notebook cell

parser.get_code_cells()  # returns List[Dict], each Dict is a code cell
parser.get_code_cell_indices()  # returns List[int], each int is a code cell's index
parser.get_code_cell_sources()  # returns List[str], each str is a code cell's Python code

parser.get_markdown_cells()  # returns List[Dict], each Dict is a markdown cel
parser.get_markdown_cell_indices()  # returns List[int], each is a markdown cell's index
parser.get_markdown_cell_sources()  # returns List[str], each is a markdown cell's text

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_notebook_parser-0.1.2.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

jupyter_notebook_parser-0.1.2-py2.py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 2 Python 3

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