{"id":15014326,"url":"https://github.com/ipython/ipynb","last_synced_at":"2025-07-25T11:39:03.248Z","repository":{"id":54610194,"uuid":"72974012","full_name":"ipython/ipynb","owner":"ipython","description":"Package / Module importer for importing code from Jupyter Notebook files (.ipynb)","archived":false,"fork":false,"pushed_at":"2024-04-15T14:14:54.000Z","size":88,"stargazers_count":253,"open_issues_count":33,"forks_count":71,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-30T10:07:13.577Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://ipynb.readthedocs.io/en/latest/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ipython.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-06T06:23:28.000Z","updated_at":"2025-03-26T21:41:38.000Z","dependencies_parsed_at":"2024-06-18T14:05:53.391Z","dependency_job_id":"9531167a-8dc2-4f32-ac06-2202c03391d4","html_url":"https://github.com/ipython/ipynb","commit_stats":{"total_commits":56,"total_committers":5,"mean_commits":11.2,"dds":0.3035714285714286,"last_synced_commit":"f82fe63596bff08c7e98743264b4a2a9dcf3b73f"},"previous_names":["yuvipanda/ipynb"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipython%2Fipynb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipython%2Fipynb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipython%2Fipynb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipython%2Fipynb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipython","download_url":"https://codeload.github.com/ipython/ipynb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478323,"owners_count":20945266,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T19:45:28.584Z","updated_at":"2025-04-06T12:09:17.432Z","avatar_url":"https://github.com/ipython.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ipynb\n\n[![Build Status](https://travis-ci.org/yuvipanda/ipynb.svg?branch=master)](https://travis-ci.org/yuvipanda/ipynb)\n\nA python package providing an easy way to explicitly import [Jupyter Notebooks](https://github.com/jupyter/notebook) files (`.ipynb`) the same way you would import regular `.py` files.\n\n## Installation ##\n\nYou can install ipynb with:\n\n```bash\npip install ipynb\n```\n\n## Importing a notebook ##\n\n### Full import ###\n\nYou can do a 'full' import - this has the same semantics of importing a .py file. All the code in the .ipynb file is executed, and classes/functions/variables in the top level are available for use.\n\nIf you have a notebook file named `server.ipynb`, you can import it via:\n\n```python\nimport ipynb.fs.full.server\n```\n\nYou can use the `from ... import ..` too.\n\n```python\nfrom ipynb.fs.full.server import X, Y, X\n```\n\n### Definitions only import ###\n\nSometimes your notebook has been used as a way to run an analysis or other computation, and you only want to import the functions / classes defined in it - and not the extra statements you have in there. This can be accomplished via `ipynb.fs.defs`.\n\nIf you have a notebook file named `server.ipynb`, and do:\n\n```python\nimport ipynb.fs.defs.server\n```\n\nIt'll only execute and make available the following parts of the code in `server.ipynb`:\n - `class` definitions\n - `def` function definitions\n - `import` statements\n - Assignment statements where the variables being assigned to are ALL_CAPS. These are assumed to be constants.\n\nThis skips most computational work and brings in your definitions only, making it easy to reuse functions / classes across similar analyses.\n\n### Relative Imports ###\n\nYou can also easily do relative imports, both for full notebooks or for definitions only. This works inside notebooks too.\n\nIf you have a notebook called `notebook1.ipynb` in the same dir as your current notebook, you can import it with:\n\n```python\nimport ipynb.fs  # Boilerplate required\n\n# Do a full import\nfrom .full.notebook1 import foo\n\n# Do a definitions-only import\nfrom .defs.notebook1 import bar\n```\n\nThis works transitively nicely - other code can import your notebook that's using relative imports and it'll all work well.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipython%2Fipynb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipython%2Fipynb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipython%2Fipynb/lists"}