--- id: unsync version: "1.4.0" license: MIT license_treatment: permissive maintenance: dormant --- # unsync — Unsynchronize asyncio License: permissive · Maintenance: dormant · Downloads: 77.3K/mo ## What it is and what it does unsync is a decorator library that abstracts away the complexity of mixing async and synchronous code by automatically managing execution contexts. When you decorate an async function with @unsync, it runs in a background event loop managed by the library; when you decorate a regular function, it runs in a thread pool by default or a process pool if marked cpu_bound=True. All decorated functions return Unfuture objects—a hybrid future type that behaves like both asyncio.Future and concurrent.futures.Future, and can be awaited or blocked on with .result(). The library is useful when you have synchronous code that doesn't support asyncio (like blocking I/O libraries) but want to run it concurrently alongside async code, or when you want to avoid writing boilerplate event loop setup. It supports chaining operations with .then(), mixing sync and async functions in pipelines, and custom event loop policies like uvloop. The main tradeoff is that you lose explicit control over the event loop and thread/process management—the library handles it implicitly. Use it for: - Run blocking I/O operations (file reads, network calls to non-async libraries) concurrently without rewriting them as async. - Execute CPU-bound work in a separate process while keeping async code responsive in the main thread. - Chain async and sync operations together using .then() without manually managing futures or callbacks. - Simplify migration of synchronous codebases by decorating functions without restructuring control flow. - Avoid event loop boilerplate when mixing asyncio with libraries that only support threading or multiprocessing. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Decorator-based library that runs async functions in an ambient event loop and regular functions in thread or process pools, returning awaitable futures that combine asyncio and concurrent.futures semantics. Yes, with conditions. The library solves a real problem—bridging async and sync code without boilerplate—and carries no security vulnerabilities or licensing concerns. However, dormancy since 2021-10-21 and unspecified Python version support mean you should verify compatibility with your target Python version before committing. Best suited for projects that need to integrate legacy synchronous libraries into async codebases and can tolerate a stable but unmaintained dependency. ## Install pip install unsync uv add unsync poetry add unsync ## Installing unsync Before you install: High install friction with no runtime dependencies. Package is dormant—last release was 2021-10-21, though the repository remains active with a recent commit on 2025-01-09. Maintenance status suggests the library is stable but not actively developed. License in practice: MIT license is permissive, allowing commercial and private use with minimal restrictions. No licensing concerns for adoption. Quickstart: from unsync import unsync import asyncio @unsync async def my_async_task(): await asyncio.sleep(1) return 'done' result = my_async_task().result() # Blocks until complete Verify before relying: - Compatibility with modern Python versions not specified in fact sheet. - Whether the library works correctly with current asyncio implementations and event loop policies. - Performance characteristics and scalability limits for large numbers of concurrent tasks. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: high - Maintenance: dormant - Downloads: 77.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags asyncio decorator, thread pool executor decorator, async without event loop, concurrent futures wrapper, background task decorator, async function decorator, thread pool async, asyncio-wrapper, concurrency-abstraction [View on SkillFed](https://skillfed.io/packages/unsync) · [View on PyPI](https://pypi.org/project/unsync/)