Skip to main content

Import .ipynb files as modules in the system path.

Project description

Load the importnb to import notebooks.

BinderBuild Status

Jupyter Extension

if __name__ == '__main__':
    %reload_ext importnb
    import readme
    assert readme.foo is 42
    assert readme.__file__.endswith('.ipynb')
else:
    foo = 42

Notebooks maybe reloaded with the standard Python Import machinery.

if __name__ == '__main__':
    from importnb import Notebook, reload
    reload(readme)
    %unload_ext importnb

Context Manager

if __name__ == '__main__':
    try:
        reload(readme)
        assert None, """Reloading should not work when the extension is unloaded"""
    except AttributeError:
        with Notebook():
            reload(readme)

Developer

if __name__ == '__main__':
    !jupyter nbconvert --to markdown readme.ipynb
    !jupyter nbconvert --to rst readme.ipynb
[NbConvertApp] Converting notebook readme.ipynb to markdown
[NbConvertApp] Writing 1280 bytes to readme.md

CHANGELOG

0.1.3

  • Include the RST files in the MANIFEST.in.

0.1.2

  • Use RST files to improve the literacy of the pypi description.

0.1.1

  • Released on PyPi

0.0.2

  • Initial Testing Release

!jupyter nbconvert --to rst changelog.ipynb
[NbConvertApp] Converting notebook changelog.ipynb to rst
[NbConvertApp] Writing 245 bytes to changelog.rst

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

importnb-0.1.3.tar.gz (8.1 kB view hashes)

Uploaded Source

Built Distribution

importnb-0.1.3-py3-none-any.whl (12.8 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