$npx skillfedfor your agent

unasync

The async transformation code.

With conditionsPyPI Build ToolsReleased May 2024253.4K downloads / moMIT OR Apache-2.0Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — unasync-0.6.0-py3-none-any.whl
v0.6.0 · released 2024-05-03 · Python >=3.8 · 2 runtime deps: tokenize-rt, setuptools

Yes, if you are building a library that needs to offer both async and sync APIs. It solves a real maintenance problem by automating code duplication at build time. Install it as a build dependency in your setup.py, not as a runtime dependency. No known vulnerabilities and permissive licensing make it low-risk.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires setuptools to be available; intended for use during package build, not runtime.
  • Low friction install with only two runtime dependencies (tokenize-rt and setuptools).
  • Actively maintained as of 2026-07-31 with 108 repository stars.

License · maintenance · safety

MIT OR Apache-2.0 (permissive) — Licensed under MIT OR Apache-2.0 (your choice), both permissive licenses with no restrictions on commercial use or redistribution.

last release 2024-05-03 (833 days) · last repo commit 2026-07-31 · 108 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 253,396 downloads/mo, #8,520 on PyPI

Verify before relying

pip install unasync

# In setup.py:
import unasync
import setuptools

setuptools.setup(
    ...,
    cmdclass={'build_py': unasync.cmdclass_build_py()},
    ...
)
  • Whether the transformation handles all async patterns or has known limitations with specific syntax.
  • Performance characteristics of the generated synchronous code compared to hand-written sync implementations.
  • How well the tool handles complex async patterns like context managers, generators, or exception handling.
Same gist for agents: .md · .json

What it is and what it does

Unasync is a build-time code transformation tool that converts asynchronous Python code into synchronous equivalents. It works by scanning a designated async source directory (typically named _async), applying token-level transformations to remove async/await keywords and replace async-specific patterns with their synchronous counterparts, then writing the result to a sync directory (typically _sync). This allows library maintainers to maintain a single async codebase while automatically generating a synchronous API variant during the build process.

The tool integrates directly into setuptools as a custom build command, making it transparent to the build pipeline. It supports customizable transformation rules via unasync.Rule instances, allowing you to specify different source and target directories and add custom token replacements beyond the defaults. This approach is used by production libraries like the official Elasticsearch Python client and other HTTP clients that need to support both async and sync calling conventions.

Use it for

  • Generate synchronous client libraries from async code to support users who cannot use async/await.
  • Maintain dual async/sync APIs in a single package without duplicating source code manually.
  • Provide backward-compatible synchronous interfaces alongside modern async implementations.
  • Reduce maintenance burden when supporting both async and sync calling patterns in HTTP clients or network libraries.
  • Automate code generation during package builds to keep sync and async versions in sync.

Worth the install?

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

With conditions

Yes, if you are building a library that needs to offer both async and sync APIs.

It solves a real maintenance problem by automating code duplication at build time. Install it as a build dependency in your setup.py, not as a runtime dependency. No known vulnerabilities and permissive licensing make it low-risk.

Install

unasync on PyPI

Before you install

Low friction install with only two runtime dependencies (tokenize-rt and setuptools). Actively maintained as of 2026-07-31 with 108 repository stars.

Requires setuptools to be available; intended for use during package build, not runtime.

License in practice

Licensed under MIT OR Apache-2.0 (your choice), both permissive licenses with no restrictions on commercial use or redistribution.

Quickstart

pip install unasync

# In setup.py:
import unasync
import setuptools

setuptools.setup(
    ...,
    cmdclass={'build_py': unasync.cmdclass_build_py()},
    ...
)

Verify before relying

  • Whether the transformation handles all async patterns or has known limitations with specific syntax.
  • Performance characteristics of the generated synchronous code compared to hand-written sync implementations.
  • How well the tool handles complex async patterns like context managers, generators, or exception handling.

Package facts

LicenseMIT OR Apache-2.0 permissive
Python supportSupports the current Python release >=3.8
Install frictionLow. Pure-Python wheel
Runtime dependencies
2 packages
tokenize-rtsetuptools
MaintenanceActively maintained 833 days since the last release
Last repo commit
First released
Downloads253,396 / month, #8,520 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Framework :: TrioLicense :: OSI Approved :: Apache Software LicenseLicense :: OSI Approved :: MIT LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Evidence: unasync-0.6.0-py3-none-any.whl

Tags

Capabilities
async to sync code generationtransform async code synchronousdual async sync libraryasync code transformation toolgenerate sync from asyncbuild-time code transformationasync sync code duplication
Topics
code-generationasync-sync-bridge
PyPI keywords
async

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 › “async to sync code generation”

  • unasyncTransforms asynchronous Python code into synchronous code during…
  • greenbackAllows you to call async functions from synchronous code that runs…
  • asyncerAsyncer provides utility functions for working with async/await code…

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

More Build Tools packages

packaging Worth it
PyPI · Build Tools · released Aug 2026

Provides reusable utilities for Python packaging interoperability, including version handling, specifiers, markers, requirements, tags, and metadata parsing according to standards like PEP 440 and PEP 425.

Apache-2.0 OR BSD-2-Clausepure Python · 3.9+
2.2Bdownloads / mo
tqdm Worth it
PyPI · Libraries · released Jul 2026

Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.

copyleftpure Python · 3.8+
648.6Mdownloads / mo
pip Worth it
PyPI · Build Tools · released Aug 2026

pip is the standard installer for Python packages, enabling you to download and install packages from the Python Package Index and other indexes into your Python environment.

MITpure Python · 3.10+
617.5Mdownloads / mo
hatchling Worth it
PyPI · Python Modules · released Aug 2026

Hatchling is a standards-compliant Python build backend that handles packaging, metadata, and distribution of Python projects when configured in a project's pyproject.toml file.

MITpure Python · 3.10+
484.2Mdownloads / mo
grpcio-tools Worth it
PyPI · Build Tools · released Jul 2026

Generates Python gRPC service stubs and message classes from Protocol Buffer definitions, enabling developers to build gRPC clients and servers.

Apache-2.0compiled wheel · 3.10+
278.2Mdownloads / mo
pre-commit Worth it
PyPI · Build Tools · released Aug 2026

pre-commit is a framework for installing and running git hooks written in any language before commits are made, automating code quality and validation checks across multi-language projects.

Install it if your team needs consistent, automated validation at commit time.

permissive licensepure Python · 3.10+
179.9Mdownloads / mo

See also synchronicity · async_generator · asgiref · async-stripe · pytest-trio · httpx · janus · trio · greenback · python-ffmpeg