{"id":14977356,"url":"https://github.com/davidesarra/jupyter_spaces","last_synced_at":"2025-10-28T03:31:22.469Z","repository":{"id":53134359,"uuid":"128975805","full_name":"davidesarra/jupyter_spaces","owner":"davidesarra","description":"Create parallel namespaces in Jupyter Notebooks","archived":false,"fork":false,"pushed_at":"2022-11-08T18:38:04.000Z","size":32,"stargazers_count":28,"open_issues_count":4,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-01T10:51:10.819Z","etag":null,"topics":["extension","ipython","ipython-magic","jupyter","jupyter-notebook","jupyterlab","namespace","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidesarra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-10T18:07:16.000Z","updated_at":"2024-10-17T14:45:20.000Z","dependencies_parsed_at":"2022-09-09T22:21:59.054Z","dependency_job_id":null,"html_url":"https://github.com/davidesarra/jupyter_spaces","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidesarra%2Fjupyter_spaces","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidesarra%2Fjupyter_spaces/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidesarra%2Fjupyter_spaces/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidesarra%2Fjupyter_spaces/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidesarra","download_url":"https://codeload.github.com/davidesarra/jupyter_spaces/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238590593,"owners_count":19497351,"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":["extension","ipython","ipython-magic","jupyter","jupyter-notebook","jupyterlab","namespace","python"],"created_at":"2024-09-24T13:55:30.341Z","updated_at":"2025-10-28T03:31:17.427Z","avatar_url":"https://github.com/davidesarra.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jupyter Spaces\n\n[![codecov](https://codecov.io/gh/davidesarra/jupyter_spaces/branch/master/graph/badge.svg)](https://codecov.io/gh/davidesarra/jupyter_spaces)\n[![Supported Python Versions](https://img.shields.io/pypi/pyversions/jupyter_spaces.svg)](https://pypi.org/project/jupyter_spaces/)\n\nJupyter Spaces is an IPython extension for creating parallel namespaces\navailable within the user namespace. It is designed to be used via IPython\nmagics in Jupyter notebooks.\n\n## Installation\n\n```bash\npip install jupyter_spaces\n```\n\n`jupyter_spaces` supports Python versions `3.6`, `3.7`, `3.8`, `3.9`, `3.10`\nand `3.11`.\n\n## Usage\n\n### Load `jupyter_spaces` extension\n\n```python\n%load_ext jupyter_spaces\n```\n\n### Reload `jupyter_spaces` extension\n\n```python\n%reload_ext jupyter_spaces\n```\n\nReloading the extension will remove all spaces.\n\n### Run a cell within a space\n\n```python\n%%space \u003cspace-name\u003e\nalpha = 0.50\nalpha\n```\n\nWhen you execute a cell within a space, all references are firstly searched in\nthe space namespace and secondly in the user namespace. All assignments are\nmade in the space namespace.\n\nTrying to delete a user namespace reference will raise an error. Trying to\naffect a user namespace reference using the keyword `global` will produce an\nexecution equivalent to not using such keyword.\n\nMutable objects in the user namespace can be altered (e.g. appending an item\nto a list).\n\n### Remove a space\n\n```python\n%remove_space \u003cspace-name\u003e\n```\n\n### Access all spaces at once\n\nYou can access all the spaces' namespaces at once without using any magic.\nThis might be useful to jointly post-process or compare the spaces' contents.\n\n```python\nfrom jupyter_spaces import get_spaces\n\nspaces = get_spaces()\nspace = spaces[\u003cspace-name\u003e]\nreference = space.namespace[\u003creference-name\u003e]\n```\n\n`Space` objects have two properties:\n\n- `name` the name of the space\n- `namespace` a dictionary with the namespace of the space\n\nModifying the spaces via `get_spaces` will actually modify the underlying\nspaces.\n\n## Acknowledgements\n\nMany thanks to [Yeray Diaz Diaz](https://github.com/yeraydiazdiaz) and\n[Karol Duleba](https://github.com/mrfuxi)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidesarra%2Fjupyter_spaces","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidesarra%2Fjupyter_spaces","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidesarra%2Fjupyter_spaces/lists"}