{"id":15621654,"url":"https://github.com/jeertmans/varscope","last_synced_at":"2026-01-20T05:03:04.885Z","repository":{"id":187667424,"uuid":"677365827","full_name":"jeertmans/varscope","owner":"jeertmans","description":"Encapsulate Python variables in scopes","archived":false,"fork":false,"pushed_at":"2024-01-30T11:43:45.000Z","size":216,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-15T14:47:10.638Z","etag":null,"topics":["python","scope","utility-library"],"latest_commit_sha":null,"homepage":"http://eertmans.be/varscope/","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/jeertmans.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":["jeertmans"]}},"created_at":"2023-08-11T11:48:06.000Z","updated_at":"2023-08-11T23:00:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"2f36a6a3-0d4b-4377-af32-2f92cb8635ea","html_url":"https://github.com/jeertmans/varscope","commit_stats":null,"previous_names":["jeertmans/varscope"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jeertmans/varscope","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeertmans%2Fvarscope","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeertmans%2Fvarscope/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeertmans%2Fvarscope/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeertmans%2Fvarscope/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeertmans","download_url":"https://codeload.github.com/jeertmans/varscope/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeertmans%2Fvarscope/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28596087,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T02:08:49.799Z","status":"ssl_error","status_checked_at":"2026-01-20T02:08:44.148Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["python","scope","utility-library"],"created_at":"2024-10-03T09:51:24.245Z","updated_at":"2026-01-20T05:03:04.861Z","avatar_url":"https://github.com/jeertmans.png","language":"Python","funding_links":["https://github.com/sponsors/jeertmans"],"categories":[],"sub_categories":[],"readme":"\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/jeertmans/varscope/main/static/logo_dark_transparent.png\"\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/jeertmans/varscope/main/static/logo_light_transparent.png\"\u003e\n  \u003cimg alt=\"VarScope Logo\" height=\"256px\" align=\"right\" src=\"https://raw.githubusercontent.com/jeertmans/varscope/main/static/logo.png\"\u003e\n\u003c/picture\u003e\n\n# VarScope\n\n[![Documentation][documentation-badge]][documentation-url]\n[![codecov][codecov-badge]][codecov-url]\n\nUltra simple module for creating local scopes in Python.\n\n## Installation\n\nVarScope can be installed with `pip`:\n\n```bash\npip install varscope\n```\n\n## Usage\n\n```python\n\u003e\u003e\u003e from varscope import scope\n\u003e\u003e\u003e\n\u003e\u003e\u003e a = 1\n\u003e\u003e\u003e with scope():  # Everything defined after will only apply inside the scope\n...     a = 2\n...     b = 3\n...\n\u003e\u003e\u003e a\n1\n\u003e\u003e\u003e b  # Not defined, because outside of scope\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nNameError: name 'b' is not defined\n\u003e\u003e\u003e\n\u003e\u003e\u003e with scope() as s:  # We can choose to keep some variables\n...     a = 2\n...     b = 3\n...     s.keep(\"b\")\n...\n\u003e\u003e\u003e b\n3\n\u003e\u003e\u003e with scope(\"a\"):  # We can also move variables inside scope\n...     a = 2\n...\n\u003e\u003e\u003e a  # Not defined, because outside of scope\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nNameError: name 'a' is not defined\n\u003e\u003e\u003e\n\u003e\u003e\u003e d = {}\n\u003e\u003e\u003e with scope():  # Scope can mutate object from outside\n...     d[\"a\"] = 1\n...\n\u003e\u003e\u003e d[\"a\"]\n1\n```\n\n[documentation-badge]: https://img.shields.io/website?down_color=lightgrey\u0026down_message=offline\u0026label=documentation\u0026up_color=green\u0026up_message=online\u0026url=https%3A%2F%2Feertmans.be%2Fvarscope%2F\n[documentation-url]: https://eertmans.be/varscope/\n[codecov-badge]: https://codecov.io/gh/jeertmans/varscope/branch/main/graph/badge.svg?token=1dJ1AKWMR5\n[codecov-url]: https://codecov.io/gh/jeertmans/varscope\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeertmans%2Fvarscope","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeertmans%2Fvarscope","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeertmans%2Fvarscope/lists"}