$ account aio-libs
aiomysql is a pure-Python MySQL/MariaDB client library for asyncio. It is effectively a port of PyMySQL's blocking driver with async I/O, plus an optional SQLAlchemy integration layer ported from aiopg. The primary programmatic entry points are `aiomysql.connect()` and `aiomysql.create_pool()`, which produce `Connection` and `Pool` objects used through `connection.cursor()`, `cursor.execute()`, and async context managers. A secondary entry point is `aiomysql.sa.create_engine()`, which wraps async pools with a SQLAlchemy engine/dialect facade for expression-based queries. The library implements MySQL protocol packet handling, authentication plugins, TLS, `LOAD DATA LOCAL INFILE`, server-side cursors, and result-set decoding. It has no web endpoints, CLI, or data pipelines; it is a dependency library, not an end-user application.
janus is a Python library that provides mixed sync-async queues for communication between threaded code and asyncio code. The core architecture centers on a single `Queue` class that internally manages both synchronous and asynchronous interfaces via proxy objects (`_SyncQueueProxy` and `_AsyncQueueProxy`). It uses thread-safe conditions (`threading.Condition`) for sync operations and asyncio conditions (`asyncio.Condition`) with careful cross-thread notification via `loop.call_soon_threadsafe`. The queue supports standard FIFO, LIFO (`LifoQueue`), and priority (`PriorityQueue`) variants through a template method pattern (overriding `_init`, `_put`, `_get`). Lifecycle management includes graceful and immediate shutdown with dedicated exception types (`SyncQueueShutDown`/`AsyncQueueShutDown`) compatible with Python 3.13+. The library is production-stable, has no external dependencies beyond the standard library, and is thoroughly tested across multiple Python versions and concurrency scenarios. It does not expose APIs beyond queue operations and is strictly a communication primitive.
multidict is a high-performance, dual-implementation (C extension and pure Python) multi-value mapping library for Python, designed primarily for HTTP headers and URL query strings. It provides `MultiDict`, `CIMultiDict` (case-insensitive), read-only proxy variants, and the `istr` case-insensitive string subclass. The C extension, built with hand-written C and aggressive optimization, delivers O(1) lookups, insertion-order preservation, and thread-safe lock-free readers under CPython's free-threading mode. The public C API capsule enables other C extensions to create and manipulate multidicts directly. The codebase exhibits exceptional engineering discipline: behavioral parity between the two implementations, extensive test coverage including property-based (Hypothesis), concurrency stress, memory leak, and benchmark regression tests, plus a structured changelog with towncrier. While tightly coupled to CPython internals and carrying significant maintenance burden from free-threading support, the core data structure patterns and concurrency primitives are elegantly designed and potentially reusable in other C extension projects.