{"id":13815151,"url":"https://github.com/python-trio/sniffio","last_synced_at":"2025-05-15T07:31:57.149Z","repository":{"id":33181353,"uuid":"142657210","full_name":"python-trio/sniffio","owner":"python-trio","description":"Sniff out which async library your code is running under","archived":false,"fork":false,"pushed_at":"2024-02-25T23:24:15.000Z","size":82,"stargazers_count":133,"open_issues_count":14,"forks_count":22,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-06T06:28:22.390Z","etag":null,"topics":["async","asyncio","python","trio"],"latest_commit_sha":null,"homepage":"https://sniffio.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/python-trio.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"python-trio","open_collective":"python-trio"}},"created_at":"2018-07-28T07:35:29.000Z","updated_at":"2025-04-18T15:02:39.000Z","dependencies_parsed_at":"2023-01-14T23:48:17.961Z","dependency_job_id":"de5dcff8-734b-447d-b709-d60e2559a4a1","html_url":"https://github.com/python-trio/sniffio","commit_stats":{"total_commits":64,"total_committers":14,"mean_commits":4.571428571428571,"dds":0.71875,"last_synced_commit":"a1cc1692f5be32645f65ebeb33e6a138180359e0"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-trio%2Fsniffio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-trio%2Fsniffio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-trio%2Fsniffio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-trio%2Fsniffio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/python-trio","download_url":"https://codeload.github.com/python-trio/sniffio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254259935,"owners_count":22040944,"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":["async","asyncio","python","trio"],"created_at":"2024-08-04T04:03:02.521Z","updated_at":"2025-05-15T07:31:57.091Z","avatar_url":"https://github.com/python-trio.png","language":"Python","funding_links":["https://github.com/sponsors/python-trio","https://opencollective.com/python-trio"],"categories":["Python"],"sub_categories":[],"readme":".. image:: https://img.shields.io/badge/chat-join%20now-blue.svg\n   :target: https://gitter.im/python-trio/general\n   :alt: Join chatroom\n\n.. image:: https://img.shields.io/badge/docs-read%20now-blue.svg\n   :target: https://sniffio.readthedocs.io/en/latest/?badge=latest\n   :alt: Documentation Status\n\n.. image:: https://img.shields.io/pypi/v/sniffio.svg\n   :target: https://pypi.org/project/sniffio\n   :alt: Latest PyPi version\n   \n.. image:: https://img.shields.io/conda/vn/conda-forge/sniffio.svg\n   :target: https://anaconda.org/conda-forge/sniffio \n   :alt: Latest conda-forge version   \n\n.. image:: https://travis-ci.org/python-trio/sniffio.svg?branch=master\n   :target: https://travis-ci.org/python-trio/sniffio\n   :alt: Automated test status\n\n.. image:: https://codecov.io/gh/python-trio/sniffio/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/python-trio/sniffio\n   :alt: Test coverage\n\n=================================================================\nsniffio: Sniff out which async library your code is running under\n=================================================================\n\nYou're writing a library. You've decided to be ambitious, and support\nmultiple async I/O packages, like `Trio\n\u003chttps://trio.readthedocs.io\u003e`__, and `asyncio\n\u003chttps://docs.python.org/3/library/asyncio.html\u003e`__, and ... You've\nwritten a bunch of clever code to handle all the differences. But...\nhow do you know *which* piece of clever code to run?\n\nThis is a tiny package whose only purpose is to let you detect which\nasync library your code is running under.\n\n* Documentation: https://sniffio.readthedocs.io\n\n* Bug tracker and source code: https://github.com/python-trio/sniffio\n\n* License: MIT or Apache License 2.0, your choice\n\n* Contributor guide: https://trio.readthedocs.io/en/latest/contributing.html\n\n* Code of conduct: Contributors are requested to follow our `code of\n  conduct\n  \u003chttps://trio.readthedocs.io/en/latest/code-of-conduct.html\u003e`_\n  in all project spaces.\n\nThis library is maintained by the Trio project, as a service to the\nasync Python community as a whole.\n\n\nQuickstart\n----------\n\n.. code-block:: python3\n\n   from sniffio import current_async_library\n   import trio\n   import asyncio\n\n   async def print_library():\n       library = current_async_library()\n       print(\"This is:\", library)\n\n   # Prints \"This is trio\"\n   trio.run(print_library)\n\n   # Prints \"This is asyncio\"\n   asyncio.run(print_library())\n\nFor more details, including how to add support to new async libraries,\n`please peruse our fine manual \u003chttps://sniffio.readthedocs.io\u003e`__.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-trio%2Fsniffio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpython-trio%2Fsniffio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-trio%2Fsniffio/lists"}