{"id":34075683,"url":"https://github.com/vdmit11/contextvars-registry","last_synced_at":"2025-12-14T09:56:32.318Z","repository":{"id":37538608,"uuid":"342399443","full_name":"vdmit11/contextvars-registry","owner":"vdmit11","description":"Python's contextvars made easy.","archived":false,"fork":false,"pushed_at":"2024-04-10T08:12:24.000Z","size":949,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-25T06:43:58.821Z","etag":null,"topics":["async","context","contextvars","gevent","python","thread-local-storage","threading","tls"],"latest_commit_sha":null,"homepage":"https://contextvars-extras.readthedocs.io","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/vdmit11.png","metadata":{"files":{"readme":"README.rst","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,"zenodo":null}},"created_at":"2021-02-25T22:46:02.000Z","updated_at":"2024-03-19T19:04:24.000Z","dependencies_parsed_at":"2024-03-22T23:27:37.499Z","dependency_job_id":"d861739d-0383-4129-8732-2016a9668196","html_url":"https://github.com/vdmit11/contextvars-registry","commit_stats":null,"previous_names":["vdmit11/contextvars-registry","vdmit11/contextvars-extras"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/vdmit11/contextvars-registry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdmit11%2Fcontextvars-registry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdmit11%2Fcontextvars-registry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdmit11%2Fcontextvars-registry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdmit11%2Fcontextvars-registry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vdmit11","download_url":"https://codeload.github.com/vdmit11/contextvars-registry/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdmit11%2Fcontextvars-registry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27725691,"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","status":"online","status_checked_at":"2025-12-14T02:00:11.348Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["async","context","contextvars","gevent","python","thread-local-storage","threading","tls"],"created_at":"2025-12-14T09:56:31.887Z","updated_at":"2025-12-14T09:56:32.313Z","avatar_url":"https://github.com/vdmit11.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"contextvars-registry\n====================\n\n|pypi badge| |build badge| |docs badge|\n\n``contextvars-registry`` is an extension for the Python's `contextvars`_ module.\n\nIn case you are not familiar with Context Variables, they work like Thread-Local storage,\nbut better: they are both thread-safe and async task-safe, have snapshots (all existing\nvars copied in O(1) time), allowing to run functions/threads/asynctasks in the copied context snapshot.\n\n.. _contextvars: https://docs.python.org/3/library/contextvars.html\n.. _ContextVar: https://docs.python.org/3/library/contextvars.html#contextvars.ContextVar\n\nThe `contextvars`_ is a powerful module, but its API seems too low-level.\n\nSo this ``contextvars_registry`` package provides some higher-level additions on top of the\nstandard API, like, for example, grouping `ContextVar`_ objects in a registry class,\nwith nice ``@property``-like access:\n\n.. code::\n\n    from contextvars_registry import ContextVarsRegistry\n\n    class CurrentVars(ContextVarsRegistry):\n        locale: str = 'en'\n        timezone: str = 'UTC'\n\n    current = CurrentVars()\n\n    # calls ContextVar.get() under the hood\n    current.timezone  # =\u003e 'UTC'\n\n    # calls ContextVar.set() under the hood\n    current.timezone = 'GMT'\n\n    # ContextVar() objects can be reached as class members\n    CurrentVars.timezone.get()  # =\u003e 'GMT'\n\nThat makes your code more readable (no more noisy ``.get()`` calls),\nand it is naturally firendly to `typing`_, so static code analysis features\n(like type checkers and auto-completion in your IDE) work nicely.\n\n.. _typing: https://docs.python.org/3/library/typing.html\n\nCheck out the `full documentation \u003chttps://contextvars-registry.readthedocs.io\u003e`_\n\nLinks\n-----\n\n- Read the Docs: https://contextvars-registry.readthedocs.io\n- GitHub repository: https://github.com/vdmit11/contextvars-registry\n- Python package: https://pypi.org/project/contextvars-registry/\n\n\n.. |pypi badge| image:: https://img.shields.io/pypi/v/contextvars-registry.svg\n  :target: https://pypi.org/project/contextvars-registry/\n  :alt: Python package version\n\n.. |build badge| image:: https://github.com/vdmit11/contextvars-registry/actions/workflows/build.yml/badge.svg\n  :target: https://github.com/vdmit11/contextvars-registry/actions/workflows/build.yml\n  :alt: Tests Status\n\n.. |docs badge| image:: https://readthedocs.org/projects/contextvars-registry/badge/?version=latest\n  :target: https://contextvars-registry.readthedocs.io/en/latest/?badge=latest\n  :alt: Documentation Status\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvdmit11%2Fcontextvars-registry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvdmit11%2Fcontextvars-registry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvdmit11%2Fcontextvars-registry/lists"}