{"categories":[{"label":"Application Frameworks","url":"https://skillfed.io/packages/category/software-development-libraries-application-frameworks"}],"enrichment":{"capability":"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.","skillfed_tags":["async-migration","greenlet-based","event-loop-interop"],"use_cases":["Incrementally port a large codebase to async/await one layer at a time, leaving middle-layer functions unchanged.","Interoperate with existing libraries that don't support async without spawning threads or rewriting their internals.","Design async APIs that need to block in places where await syntax is forbidden, such as property getters.","Call async functions from synchronous wrapper functions in a legacy codebase without full conversion.","Bridge between synchronous and asynchronous code paths within the same event loop task."],"what_it_does":"Greenback solves the problem of incrementally migrating a synchronous codebase to async/await syntax. When you port code to asyncio or Trio, you typically must convert every function in the call chain to async, even if most of them don't perform I/O themselves. Greenback lets you call async functions from synchronous code, as long as that sync code was originally invoked from an async task that set up a greenback portal.\n\nIt works by running your async task inside a greenlet, then using greenlet's context-switching to jump back to the parent greenlet (which has direct access to the event loop) when you call greenback.await_(). The result or exception from the async call is then returned to the task greenlet. The library is pure Python on top of the mature greenlet C module, with minimal overhead.","worth_installing":"Yes, if you need to migrate existing sync code to async incrementally or interoperate with non-async libraries without threading. The library is actively maintained, has no known vulnerabilities, low install friction, and is permissively licensed. The main trade-off is a small performance cost per task and the requirement that C extensions used alongside greenback must be well-behaved. For greenfield async projects, it's unnecessary; for bridging sync and async, it's a solid choice."},"id":"greenback","links":{"html":"https://skillfed.io/packages/greenback","md":"https://skillfed.io/packages/greenback.md","pypi":"https://pypi.org/project/greenback/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2025-12-23","license_spdx":null,"license_treatment":"permissive","name":"greenback","python_support":"supports_current","summary":"Reenter an async event loop from synchronous code"},"popularity":{"monthly_downloads":9609038,"position":1520,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"1.3.0"}
