{"id":15663531,"url":"https://github.com/hellysmile/contextvars_executor","last_synced_at":"2025-08-10T13:32:39.998Z","repository":{"id":33014714,"uuid":"149828166","full_name":"hellysmile/contextvars_executor","owner":"hellysmile","description":"contextvars friendly ThreadPoolExecutor","archived":false,"fork":false,"pushed_at":"2024-10-30T02:54:20.000Z","size":26,"stargazers_count":15,"open_issues_count":10,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-01T02:35:19.464Z","etag":null,"topics":["asyncio","contextvars"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/contextvars-executor/","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/hellysmile.png","metadata":{"files":{"readme":"README.rst","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":"2018-09-21T23:18:14.000Z","updated_at":"2024-06-12T21:25:42.000Z","dependencies_parsed_at":"2023-02-15T18:25:43.178Z","dependency_job_id":"0a4e2d92-a45f-4ca0-87d9-e8a238a1fee9","html_url":"https://github.com/hellysmile/contextvars_executor","commit_stats":{"total_commits":23,"total_committers":2,"mean_commits":11.5,"dds":"0.26086956521739135","last_synced_commit":"4688bec7a8e031bc6ecfec10c3833ef1529ee24a"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellysmile%2Fcontextvars_executor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellysmile%2Fcontextvars_executor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellysmile%2Fcontextvars_executor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellysmile%2Fcontextvars_executor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hellysmile","download_url":"https://codeload.github.com/hellysmile/contextvars_executor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229421559,"owners_count":18070351,"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":["asyncio","contextvars"],"created_at":"2024-10-03T13:37:52.290Z","updated_at":"2024-12-12T17:04:15.476Z","avatar_url":"https://github.com/hellysmile.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"contextvars_executor\n====================\n\n:info: contextvars friendly ThreadPoolExecutor\n\n.. image:: https://travis-ci.org/hellysmile/contextvars_executor.svg?branch=master\n    :target: https://travis-ci.org/hellysmile/contextvars_executor\n\n.. image:: https://img.shields.io/pypi/v/contextvars_executor.svg\n    :target: https://pypi.python.org/pypi/contextvars_executor\n\n.. image:: https://codecov.io/gh/hellysmile/contextvars_executor/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/hellysmile/contextvars_executor\n\nInstallation\n------------\n\n.. code-block:: shell\n\n    pip install contextvars_executor\n\nWhy???\n------\n\n* `related Python issue \u003chttps://bugs.python.org/issue34014\u003e`_\n\nUsage\n-----\n\n.. code-block:: python\n\n    import asyncio\n    import contextvars\n\n    from contextvars_executor import ContextVarExecutor\n\n    ctx = contextvars.ContextVar('42')\n\n\n    def thread():\n        ret = ctx.get()\n\n        assert ret == 42\n\n        return ret\n\n\n    async def main(*, loop):\n        ctx.set(42)\n\n        ret = await loop.run_in_executor(None, thread)\n\n        assert ret == 42\n\n\n    loop = asyncio.get_event_loop()\n    loop.set_default_executor(ContextVarExecutor())\n    loop.run_until_complete(main(loop=loop))\n\nPython 3.7+ is required, there is no need to support older python versions!!!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellysmile%2Fcontextvars_executor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhellysmile%2Fcontextvars_executor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellysmile%2Fcontextvars_executor/lists"}