skillfed

sniffio

Sniff out which async library your code is running under

sniffio Permissive license MIT OR Apache-2.0 Active 153 v1.3.1 released

Install

sniffio on PyPI

pip

pip install sniffio

uv

uv add sniffio

poetry

poetry add sniffio

Package 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

Development Status :: 5 - Production/StableFramework :: AsyncIOFramework :: TrioIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseLicense :: OSI Approved :: MIT LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

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.
detect async library runtimeasyncio vs trio detectionwhich async framework am i inasync library sniffingmulti-async library supportcurrent async backend detectionasync runtime identification

Similar packages