{"categories":[{"label":"Build Tools","url":"https://skillfed.io/packages/category/software-development-build-tools/3"}],"enrichment":{"capability":"Transforms asynchronous Python code into synchronous code during package build, enabling maintainers to generate both async and sync APIs from a single async source.","skillfed_tags":["code-generation","async-sync-bridge"],"use_cases":["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."],"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.\n\nThe 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.","worth_installing":"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."},"id":"unasync","links":{"html":"https://skillfed.io/packages/unasync","md":"https://skillfed.io/packages/unasync.md","pypi":"https://pypi.org/project/unasync/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2024-05-03","license_spdx":null,"license_treatment":"permissive","name":"unasync","python_support":"supports_current","summary":"The async transformation code."},"popularity":{"monthly_downloads":253396,"position":8520,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.6.0"}
