{"id":15688171,"url":"https://github.com/uiuc-sine/ipython-cells","last_synced_at":"2025-10-26T23:32:02.489Z","repository":{"id":62571626,"uuid":"172156191","full_name":"UIUC-SINE/ipython-cells","owner":"UIUC-SINE","description":"IPython extension for running code blocks in .py files","archived":false,"fork":false,"pushed_at":"2024-05-02T20:49:55.000Z","size":129,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T03:17:22.554Z","etag":null,"topics":["ipython","ipython-magic","jupyter"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UIUC-SINE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-02-23T01:15:49.000Z","updated_at":"2025-03-06T23:45:29.000Z","dependencies_parsed_at":"2024-10-23T20:44:29.292Z","dependency_job_id":"3123dd1a-c274-4d28-92c1-f4969caa0bd7","html_url":"https://github.com/UIUC-SINE/ipython-cells","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UIUC-SINE%2Fipython-cells","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UIUC-SINE%2Fipython-cells/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UIUC-SINE%2Fipython-cells/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UIUC-SINE%2Fipython-cells/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UIUC-SINE","download_url":"https://codeload.github.com/UIUC-SINE/ipython-cells/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252802445,"owners_count":21806503,"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":["ipython","ipython-magic","jupyter"],"created_at":"2024-10-03T17:55:57.541Z","updated_at":"2025-10-26T23:31:57.455Z","avatar_url":"https://github.com/UIUC-SINE.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ipython-cells\n\nThis is an IPython extension for those who prefer to work in a terminal but still need the cell-by-cell execution provided by a Jupyter notebook.\n\nExample Jupyter notebook:\n\n![](notebook.png)\n\nRunning exported notebook with ipython-cells:\n\n![](commandline.png)\n\n\n## Quickstart\n\nInstall the extension:\n\n    pip install ipython-cells\n    \nConvert an existing notebook to a Python file (In Jupyter):\n\n    Cell \u003e Run All\n    File \u003e Download As \u003e python (.py)\n\nExecute cells in iPython:\n\n``` python\n\u003e\u003e\u003e %load_ext ipython_cells\n\u003e\u003e\u003e %load_file my_notebook.py\n\u003e\u003e\u003e %cell_run 1\n\u003e\u003e\u003e %cell_run 2\narray([1.+0.j, 1.+0.j, 1.+0.j, 1.+0.j, 1.+0.j, 1.+0.j, 1.+0.j, 1.+0.j])\n```\n\nYou can freely add/delete/rename cells in the downloaded `my_notebook.py`.  `my_notebook.py` is automatically reloaded when changes are made.\n   \nAlternatively, you can create a new .py file from scratch without starting from a Jupyter notebook.  See the [cell delimiter syntax](#cell-delimiter-syntax).\n\n## Other Features\n\nSpyder cell delimiter syntax is also supported:\n\n``` python\n# %% cell1\nprint('hello')\n\n# %% cell2\nprint('world')\n```\n\nOther commands:\n\n``` python\n# cell ranges - run all cells from beginning of file to cell2 (inclusive)\n\u003e\u003e\u003e %cell_run ^cell2\nhello\nworld\n\n# cell ranges - run all cells from cell1 (inclusive) to end of file\n\u003e\u003e\u003e %cell_run cell1$\nhello\nworld\n\n# list available cells for running\n\u003e\u003e\u003e %list_cells\n['__first', 'cell1', 'cell2']\n```\n\n\n## Automatically Load Extension\n\nTo load extension on IPython start, add this to `~/.ipython/profile_default/ipython_config.py`\n\n``` python\nc.InteractiveShellApp.extensions = [\n    'ipython_cells'\n]\n```\n\n## Autoreloading\n``` python\n# load example.py with autoreloading\n%load_file example.py\n\n%cell_run cell1\n10\n# example.py is modified by an external editor (e.g. `a = 10`  -\u003e  `a = 20`)\n# File change is detected and automatically reloaded\n%cell_run cell1\n20\n\n```\n\nAuto reloading can be disabled with `%load_file example.py --noreload`\n\n## Cell Delimiter Syntax\n\nCells are delimited by special comments.  Both Jupyter and Spyder style cells are supported.  Below are different variations of a cell called `foobar_cell`.\n\n- `# %% foobar_cell`\n- `# In[foobar_cell]`\n- `# %% foobar_cell some extra text`\n- `# In[foobar_cell] some extra text`\n\n## Running Exported Jupyter Notebooks\n\nThis extension can run exported Jupyter notebooks. (`File \u003e Download As \u003e python (.py)`).\n\nBe sure to run all cells before exporting so they are assigned an index. (`Cell \u003e Run All`).\n\n## Tests\n\n    cd tests\n    ipython3 tests.py\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuiuc-sine%2Fipython-cells","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuiuc-sine%2Fipython-cells","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuiuc-sine%2Fipython-cells/lists"}