{"id":23882,"library":"importnb","title":"importnb","description":"Import Jupyter Notebooks as Python modules and scripts. Supports Python 3.8+, and allows importing .ipynb files directly. Version 2023.11.1 adds Python 3.12 compatibility, top-level await async support, and improved entry points. Release cadence is sporadic, with minor updates as needed.","status":"active","version":"2023.11.1","language":"python","source_language":"en","source_url":"https://github.com/deathbeds/importnb","tags":["jupyter","notebook","import","module","ipynb"],"install":[{"cmd":"pip install importnb","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Notebook is a top-level import, not a submodule.","wrong":"from importnb.notebook import Notebook","symbol":"Notebook","correct":"from importnb import Notebook"},{"note":"","wrong":null,"symbol":"importnb","correct":"import importnb"}],"quickstart":{"code":"import os\nos.environ['SOME_KEY'] = 'test'  # placeholder auth\nimport importnb\nfrom importnb import Notebook\nwith Notebook():\n    import my_notebook  # my_notebook.ipynb in the same directory","lang":"python","description":"Basic usage: use Notebook context manager to import .ipynb files as modules."},"warnings":[{"fix":"Rename your notebook file to avoid conflicts.","message":"importing a notebook with the same name as a standard library module (e.g., `json`) will shadow the standard library. Ensure filenames are unique.","severity":"gotcha","affected_versions":"all"},{"fix":"Avoid relying on importnb.parameterize; use pytest or parametrize directly.","message":"The `parameterize` feature (from importnb.parameterize) is optional and may be removed in future versions. It is no longer maintained.","severity":"deprecated","affected_versions":">=0.7.0, <2023.11.1"},{"fix":"Ensure your notebook files end with .ipynb.","message":"Notebooks must have a `.ipynb` extension; files with other extensions (e.g., `.py`) are not supported.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'2023.11.1':20 '3.12':23 '3.8':12 'add':21 'allow':14 'async':29 'await':28 'cadenc':36 'compat':24 'direct':18 'entri':33 'file':17 'import':2,15,46 'importnb':1 'improv':32 'ipynb':16,48 'jupyt':3,44 'level':27 'minor':40 'modul':7,47 'need':43 'notebook':4,45 'point':34 'python':6,11,22 'releas':35 'script':9 'sporad':38 'support':10,30 'top':26 'top-level':25 'updat':41 'version':19","created_at":"2026-05-01T08:10:07.583123+00:00","updated_at":"2026-05-01T08:10:07.583123+00:00","problems":[{"fix":"Use: `from importnb import Notebook`","cause":"Incorrect import path: trying to import submodule that does not exist.","error":"ModuleNotFoundError: No module named 'importnb.notebook'"},{"fix":"Ensure the .ipynb file is in the same directory as your script or use sys.path.append().","cause":"The file is missing or not in the current working directory.","error":"ValueError: The notebook file 'my_notebook.ipynb' does not exist."},{"fix":"Check notebook cells for syntax errors and ensure compatibility with your Python version.","cause":"The notebook contains Python code that is not valid Python 3.x (e.g., syntax from a future version).","error":"SynaxError: invalid syntax in cell (notebook)"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2023.11.1","cli_name":"importnb","cli_version":"usage: importnb [-h] [-m MODULE] [-c CODE] [-d DIR] [-t] [file] ...","type":"library","homepage":null,"github":"https://github.com/deathbeds/importnb#readme","docs":"https://github.com/deathbeds/importnb#readme","changelog":null,"pypi":"https://pypi.org/project/importnb/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}