Skip to main content

Converts .ipynb files to .py files.

Project description

jnb2py

jnb2py is a Python library for converting Notebooks(.ipynb) into Python (.py) files.

Quickstart

jnb2py requires an installation of Python 3.10 or greater, as well as pip.

Installation

jnb2py requires an installation of Python 3.10 or greater, as well as pip. (Pip is typically bundled with Python installations.)

To install from PyPI with pip:

pip install jnb2py

Using nb2py in a Python Script

To convert a notebook, you'll need to do this.

>>> from jnb2py import Converter
>>> file_path = "/path/to/the/notebook.ipynb"
>>> converter = Converter(file_path)
>>> output_file_name = "extract_code.py"
>>> output_path = "/path/to/the/output/destination"
>>> converter.convert_to_py(output_file_name, output_path)

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

jnb2py-0.0.2.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

jnb2py-0.0.2-py3-none-any.whl (5.4 kB view hashes)

Uploaded 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