{"id":23428309,"url":"https://github.com/answerdotai/execnb","last_synced_at":"2026-04-26T05:04:21.291Z","repository":{"id":37077408,"uuid":"500173406","full_name":"AnswerDotAI/execnb","owner":"AnswerDotAI","description":"Execute a jupyter notebook, fast, without needing jupyter","archived":false,"fork":false,"pushed_at":"2025-04-05T23:50:34.000Z","size":1123,"stargazers_count":131,"open_issues_count":3,"forks_count":11,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-11T21:06:22.478Z","etag":null,"topics":["answerai","answerdotai","fastai","jupyter","nbdev","notebook"],"latest_commit_sha":null,"homepage":"https://answerdotai.github.io/execnb/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AnswerDotAI.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-06-05T18:02:53.000Z","updated_at":"2025-04-20T04:06:13.000Z","dependencies_parsed_at":"2024-06-18T18:22:33.965Z","dependency_job_id":"ea00dd07-81ae-417a-b8d5-5634d2bcf227","html_url":"https://github.com/AnswerDotAI/execnb","commit_stats":{"total_commits":130,"total_committers":7,"mean_commits":"18.571428571428573","dds":"0.43846153846153846","last_synced_commit":"852d215bad20765ac328a12045e16d8cdb065d16"},"previous_names":["fastai/execnb"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnswerDotAI%2Fexecnb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnswerDotAI%2Fexecnb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnswerDotAI%2Fexecnb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnswerDotAI%2Fexecnb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnswerDotAI","download_url":"https://codeload.github.com/AnswerDotAI/execnb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254436944,"owners_count":22070946,"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":["answerai","answerdotai","fastai","jupyter","nbdev","notebook"],"created_at":"2024-12-23T07:11:24.756Z","updated_at":"2026-04-26T05:04:21.279Z","avatar_url":"https://github.com/AnswerDotAI.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# execnb\n\n\n\u003c!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! --\u003e\n\n[![CI](https://github.com/fastai/execnb/actions/workflows/test.yaml/badge.svg)](https://github.com/fastai/execnb/actions/workflows/test.yaml)\n[![Deploy to GitHub\nPages](https://github.com/fastai/execnb/actions/workflows/deploy.yaml/badge.svg)](https://github.com/fastai/execnb/actions/workflows/deploy.yaml)\n\n## Install\n\nEither:\n\n    pip install execnb\n\nor if you use conda:\n\n    conda install -c fastai execnb\n\n(You can replace `conda` with `mamba` in the line above if you have\nmamba installed.)\n\n## How to use\n\nUse\n[`CaptureShell`](https://AnswerDotAI.github.io/execnb/shell.html#captureshell)\nto run Jupyter code and capture notebook outputs, without running a\nJupyter server (or even having it installed):\n\n``` python\nfrom execnb.shell import *\nfrom fastcore.utils import *\nfrom fastcore.nbio import *\n```\n\n``` python\ns = CaptureShell()\ns.run('1+1')\n```\n\n    [{'data': {'text/plain': ['2']},\n      'metadata': {},\n      'output_type': 'execute_result',\n      'execution_count': None}]\n\nTo execute a notebook and save it with outputs filled in, use\n[`CaptureShell.execute`](https://AnswerDotAI.github.io/execnb/shell.html#captureshell.execute):\n\n``` python\ntry:\n    s.execute('../tests/clean.ipynb', 'tmp.ipynb')\n    print(read_nb('tmp.ipynb').cells[1].outputs)\nfinally: Path('tmp.ipynb').unlink()\n```\n\n    [{'name': 'stdout', 'output_type': 'stream', 'text': ['1\\n']}, {'data': {'text/plain': ['2']}, 'execution_count': None, 'metadata': {}, 'output_type': 'execute_result'}]\n\nYou can also execute notebooks from the command line with\n[`exec_nb`](https://AnswerDotAI.github.io/execnb/shell.html#exec_nb):\n\n``` python\n!exec_nb --help\n```\n\n    usage: exec_nb [-h] [--dest DEST] [--exc_stop] [--inject_code INJECT_CODE]\n                   [--inject_path INJECT_PATH] [--inject_idx INJECT_IDX] [--verbose]\n                   src\n\n    Execute notebook from `src` and save with outputs to `dest`\n\n    positional arguments:\n      src                        Notebook path to read from\n\n    options:\n      -h, --help                 show this help message and exit\n      --dest DEST                Notebook path to write to (default: )\n      --exc_stop                 Stop on exceptions? (default: False)\n      --inject_code INJECT_CODE  Code to inject into a cell\n      --inject_path INJECT_PATH  Path to file containing code to inject into a cell\n      --inject_idx INJECT_IDX    Cell to replace with `inject_code` (default: 0)\n      --verbose                  Show stdout/stderr during execution (default:\n                                 False)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanswerdotai%2Fexecnb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanswerdotai%2Fexecnb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanswerdotai%2Fexecnb/lists"}