sniffio
Sniff out which async library your code is running under
Install
sniffio on PyPI
pip
pip install sniffiouv
uv add sniffiopoetry
poetry add sniffioPackage facts
| License | MIT OR Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 900 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the 100 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: sniffio-1.3.1-py3-none-any.whl
Keywords: async, trio, asyncio
About sniffio
from the package's own PyPI description — quoted content, verbatim
.. image:: https://img.shields.io/badge/chat-join%20now-blue.svg :target: https://gitter.im/python-trio/general :alt: Join chatroom
.. image:: https://img.shields.io/badge/docs-read%20now-blue.svg :target: https://sniffio.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status
.. image:: https://img.shields.io/pypi/v/sniffio.svg :target: https://pypi.org/project/sniffio :alt: Latest PyPi version
.. image:: https://img.shields.io/conda/vn/conda-forge/sniffio.svg :target: https://anaconda.org/conda-forge/sniffio :alt: Latest conda-forge version
.. image:: https://travis-ci.org/python-trio/sniffio.svg?branch=master :target: https://travis-ci.org/python-trio/sniffio :alt: Automated test status
.. image:: https://codecov.io/gh/python-trio/sniffio/branch/master/graph/badge.svg :target: https://codecov.io/gh/python-trio/sniffio :alt: Test coverage
================================================================= sniffio: Sniff out which async library your code is running under =================================================================
You're writing a library. You've decided to be ambitious,...
Read as markdown · JSON record · Source repository · Homepage · Docs
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
Detects which async library your code is currently running under, enabling libraries to support multiple async frameworks with a single codebase.
Minimal friction: pure Python wheel with zero runtime dependencies, actively maintained with recent commits, and ranked in the top 100 PyPI packages.
Dual-licensed under MIT or Apache-2.0 (your choice), both permissive licenses with no copyleft obligations—suitable for proprietary or open-source projects.
Usage
pip install sniffio
from sniffio import current_async_library
async def check():
lib = current_async_library()
print(f"Running under: {lib}")
Requires Python 3.7 or later; must be called from within an active async context.
Verdict: A lightweight, well-maintained utility for multi-async-framework libraries. Zero dependencies, permissive dual licensing, active development, and no known vulnerabilities make it a low-risk addition to async codebases that need runtime library detection.
Needs verification
- Whether sniffio's detection works reliably with all async libraries beyond those documented.
- Performance overhead of calling current_async_library() in hot code paths.
Similar packages
permissive · top 1,000 on PyPI
triopermissive · top 1,000 on PyPI
trio-websocketpermissive · top 1,000 on PyPI
anyiopermissive · top 100 on PyPI
h11permissive · top 100 on PyPI
uvicornpermissive · top 100 on PyPI
httpxpermissive · top 100 on PyPI
sortedcontainerspermissive · top 1,000 on PyPI
shellinghampermissive · top 1,000 on PyPI
httpcorepermissive · top 100 on PyPI