unsync is a decorator-based library that bridges synchronous and asynchronous Python code. It allows you to call async functions from sync code and vice versa without manually managing event loops. Current version is 1.4.0. Release cadence is low; last release was in 2020.
pip install unsyncVerified import paths — ran on the pinned version, not inferred.
Decorate an async function with @unsync to call it from synchronous code; the decorated function returns a concurrent.futures.Future or similar object.
Use await directly when already in an async function instead of @unsync.
Call .result() on the returned object to get the value (e.g., async_function().result()).
Use asyncio.run() for top-level async calls instead of relying on unsync's loop management.
Ensure there is a running event loop, or use asyncio.run() or unsync's own setup if in a synchronous context.
Use 'from unsync import unsync' to import the decorator.
No dependency data recorded yet.