{"categories":[{"label":"Application Frameworks","url":"https://skillfed.io/packages/category/software-development-libraries-application-frameworks/3"}],"enrichment":{"capability":"Duet is a lightweight async library that wraps Future objects to enable async/await syntax around APIs that return futures, such as gRPC, while supporting re-entrant event loops.","skillfed_tags":["async-futures","grpc-integration","re-entrant"],"use_cases":["Wrapping gRPC or other RPC library futures to use them in async/await code without rewriting the underlying API.","Gradually refactoring synchronous code to async by allowing re-entrant duet.run() calls during the transition.","Building async wrappers around legacy libraries that return futures but lack native async support.","Combining Future-based parallelism with structured concurrency patterns in a lightweight package."],"what_it_does":"Duet is a minimal async library designed to bridge the gap between Future-based APIs (like gRPC) and Python's async/await syntax. Rather than implementing its own event loop, it wraps standard Future objects in awaitable wrappers so you can use them in async functions. The library takes inspiration from structured concurrency but differs in two key ways: it focuses on Future integration rather than full async I/O, and it allows re-entrant event loops\u2014meaning you can call duet.run() from within code that's already running inside duet.run(), which most async libraries forbid. This re-entrancy can simplify gradual refactoring of codebases to async without requiring a complete separation of sync and async code upfront.\n\nDuet depends only on typing-extensions and installs as a pure Python wheel, keeping overhead minimal. It's actively maintained but with infrequent releases; the last update was over a year ago. The library is not an official Google project, though it lives in the Google GitHub organization.","worth_installing":"Yes, if you need to integrate Future-based APIs (especially gRPC) into async code or are refactoring a codebase incrementally. The low install friction, permissive license, and re-entrancy feature make it a pragmatic choice for that niche. No known vulnerabilities. Not recommended as a general-purpose async framework."},"id":"duet","links":{"html":"https://skillfed.io/packages/duet","md":"https://skillfed.io/packages/duet.md","pypi":"https://pypi.org/project/duet/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2023-07-26","license_spdx":null,"license_treatment":"permissive","name":"duet","python_support":"supports_current","summary":"A simple future-based async library for python."},"popularity":{"monthly_downloads":391821,"position":7010,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.2.9"}
