$npx skillfedfor your agent

sniffio

Sniff out which async library your code is running under

Worth itPyPI Released Feb 2024487.2M downloads / moMIT OR Apache-2.0Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — sniffio-1.3.1-py3-none-any.whl
v1.3.1 · released 2024-02-25 · Python >=3.7

Yes. Sniffio is a tiny, stable, zero-dependency utility that solves a real problem for anyone writing async libraries. It's actively maintained, permissively licensed, and widely used (top 100 PyPI by downloads). Install it if you're building multi-framework async support; skip it if you're only targeting one framework.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Must be called from within an active async context (inside an async function running under asyncio, Trio, or another supported library).
  • Low friction: pure Python wheel with no runtime dependencies.
  • Actively maintained by the Trio project with recent commits and stable release status.

License · maintenance · safety

MIT OR Apache-2.0 (permissive) — Dual-licensed under MIT or Apache-2.0 (your choice), both permissive. No restrictions on commercial or proprietary use.

last release 2024-02-25 (901 days) · last repo commit 2026-03-06 · 153 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 487,249,508 downloads/mo, #82 on PyPI

Verify before relying

from sniffio import current_async_library
import asyncio

async def check():
    lib = current_async_library()
    print(lib)

asyncio.run(check())
  • Complete list of supported async libraries beyond asyncio and Trio
  • Whether detection works with nested or concurrent async contexts
Same gist for agents: .md · .json

What it is and what it does

Sniffio is a lightweight utility library that answers a single question: which async I/O framework is currently running your code? When you're writing a library that needs to support both asyncio and Trio (or other async frameworks), you need a way to branch your code path at runtime. This package provides exactly that—a `current_async_library()` function that returns the name of the active async library.

The package has no runtime dependencies and is pure Python, making it trivial to add to any project. It's maintained by the Trio project as a service to the broader async Python community. The detection works by inspecting the current execution context to identify which async library is active, allowing multi-framework libraries to adapt their behavior without requiring users to pass configuration flags.

Use it for

  • Write a library that works with both asyncio and Trio without duplicating code paths
  • Conditionally apply framework-specific optimizations or workarounds at runtime
  • Debug or log which async framework a user's code is running under
  • Build async utilities that need to behave differently depending on the underlying framework

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

Sniffio is a tiny, stable, zero-dependency utility that solves a real problem for anyone writing async libraries. It's actively maintained, permissively licensed, and widely used (top 100 PyPI by downloads). Install it if you're building multi-framework async support; skip it if you're only targeting one framework.

Install

sniffio on PyPI

Before you install

Low friction: pure Python wheel with no runtime dependencies. Actively maintained by the Trio project with recent commits and stable release status.

Must be called from within an active async context (inside an async function running under asyncio, Trio, or another supported library).

License in practice

Dual-licensed under MIT or Apache-2.0 (your choice), both permissive. No restrictions on commercial or proprietary use.

Quickstart

from sniffio import current_async_library
import asyncio

async def check():
    lib = current_async_library()
    print(lib)

asyncio.run(check())

Verify before relying

  • Complete list of supported async libraries beyond asyncio and Trio
  • Whether detection works with nested or concurrent async contexts

Package facts

LicenseMIT OR Apache-2.0 permissive
Python supportSupports the current Python release >=3.7
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 901 days since the last release
Last repo commit
First released
Downloads487,249,508 / month, #82 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
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

Evidence: sniffio-1.3.1-py3-none-any.whl

Tags

Capabilities
detect async library runtimeasyncio vs trio detectionwhich async framework am i usingasync library detectionmulti-async library supportsniff async runtimeasyncio trio compatibility
Topics
async-runtime-detectionmulti-framework-support
PyPI keywords
asynctrioasyncio

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “detect async library runtime”

  • sniffioDetects which async library (asyncio, Trio, etc.) your code is…
  • googletransGoogletrans translates text and detects languages by calling Google…
  • bluetooth-adaptersEnumerates and locates Bluetooth adapters on a system, providing…

Give your agent the search over MCP, or paste the wish link into any chat.

Similar packages

trio Worth it
PyPI · Networking · released Aug 2026

Trio is an async I/O library that lets you write concurrent Python programs using async/await syntax, handling multiple network connections, file operations, and tasks simultaneously with a focus on correctness and ease of use.

Install it if you need to write concurrent I/O code and prefer structured concurrency principles and a simpler API over asyncio.

MIT OR Apache-2.0pure Python · 3.10+
56.1Mdownloads / mo
pytest-trio With conditions
PyPI · Testing · released Nov 2022

A pytest plugin that enables testing of async code written with Trio, allowing you to write and run async test functions directly within pytest.

Apache-2.0pure Python · 3.7+aging
394.5Kdownloads / mo
anyio Worth it
PyPI · released Jul 2026

AnyIO provides a unified asynchronous API that runs on either asyncio or Trio, implementing structured concurrency patterns and offering high-level networking, synchronization, and I/O primitives.

Install it if you need to support multiple async backends, want structured concurrency in asyncio, or are building a library that should work across both ecosystems.

MITpure Python · 3.10+
1.0Bdownloads / mo
trio-websocket With conditions
PyPI · Libraries · released Feb 2025

Implements WebSocket protocol (RFC 6455) for both client and server using the Trio async framework, built on wsproto for protocol handling and I/O.

However, be aware the project is on life-support maintenance with infrequent releases (535 days since last release).

MITpure Python · 3.8+aging
41.1Mdownloads / mo
flake8-async With conditions
PyPI · Quality Assurance · released Jul 2026

A flake8 plugin that detects async-related issues in code using Trio, AnyIO, or asyncio, flagging bugs, dead code, performance problems, and idiom violations.

MITpure Python · 3.9+
351.9Kdownloads / mo
greenback With conditions
PyPI · Application Frameworks · released Dec 2025

Allows you to call async functions from synchronous code that runs within an asyncio or Trio event loop, bridging the gap between sync and async codebases without threading.

Apache-2.0pure Python · 3.8+
9.6Mdownloads / mo

See also pytest-aio · trio-typing · python-socks · asyncclick