culsans
Thread-safe async-aware queue for Python
What it is and what it does
Culsans is a dual-interface queue library that lets synchronous and asynchronous code communicate through a single queue object. It exposes a `.sync_q` property for threaded, eventlet, or gevent code and an `.async_q` property for asyncio, trio, or curio code, allowing you to bridge concurrency models that normally don't mix. The synchronous interface is fully compatible with Python's standard queue module, while the asynchronous interface follows asyncio queue semantics.
The library is built on aiologic and inspired by janus, but extends support to include trio and curio on the async side, and eventlet and gevent on the sync side. It includes features like dynamic maxsize adjustment, peek operations, atomic clearing, and the ability to subclass queues with custom storage backends. All internal methods are called in exclusive access mode, so custom subclasses don't need to worry about thread-safety.
Use it for:
- Bridging legacy synchronous code running in threads with new asyncio-based services in the same application.
- Distributing work between a thread pool and an async task group without manual synchronization primitives.
- Building adapter layers that accept messages from both sync and async producers and route them appropriately.
- Migrating from standard queue to async-aware queues while keeping existing threaded code intact.
- Coordinating between eventlet or gevent greenlets and trio or asyncio tasks in polyglot concurrency setups.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a dual-interface queue (sync and async) that bridges synchronous threaded code with asynchronous code across multiple async frameworks and sync concurrency models.
Yes, if you need to bridge sync and async code in the same process. The low install friction, permissive ISC license, active maintenance, and broad concurrency framework support make it a solid choice for this specific problem. The Alpha status is not a blocker given recent activity and zero known vulnerabilities, but test it in your target concurrency mix before production use.
Install
culsans on PyPI
pip
pip install culsansuv
uv add culsanspoetry
poetry add culsansInstalling culsans
Before you install
Low install friction with only 2 runtime dependencies (aiologic and typing-extensions). Actively maintained with recent commits; marked as Alpha but in active development since 2024-11-02.
License in practice
ISC License (permissive) places minimal restrictions on use, modification, and distribution; suitable for both open-source and proprietary projects.
Quickstart
import culsans
queue = culsans.Queue()
# Sync side: queue.sync_q.put(item)
# Async side: await queue.async_q.get()
queue.shutdown()
Requires Python 3.8 or later; async usage requires asyncio, trio, or curio; sync usage with eventlet or gevent requires those libraries installed separately.
Verify before relying
- Whether the checkpoint behavior inherited from aiologic has measurable performance impact in typical workloads.
- Real-world stability and maturity signals beyond the Alpha classification and download metrics.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — aiologic, typing-extensions |
| Maintenance | actively maintained — 226 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,892,340/month — #2,838 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: culsans-0.11.0-py3-none-any.whl
Keywords: anyio, async, async-await, asyncio, communication, concurrency, eventlet, gevent, greenlet, library, mypy, python, queue, thread-safety, threading, trio
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
janusProvides a thread-safe queue with both…
permissive · top 5,000 on PyPI
aiologicaiologic provides thread-aware and async-aware…
permissive · top 5,000 on PyPI
aiochannelProvides asyncio-compatible channels (closable…
permissive · top 15,000 on PyPI
anyioAnyIO provides a unified asynchronous API that…
permissive · top 100 on PyPI
gcloud-rest-taskqueueAsyncio and threadsafe Python client for Google…
permissive · top 15,000 on PyPI
greenbackAllows you to call async functions from…
permissive · top 5,000 on PyPI
gcloud-aio-taskqueueAsyncio and threadsafe Python client library…
permissive · top 15,000 on PyPI
synchronicityWraps async functions, generators, and classes…
permissive · top 1,000 on PyPI
duetDuet is a lightweight async library that wraps…
permissive · top 15,000 on PyPI
psycogreenIntegrates psycopg2 with coroutine libraries…
permissive · top 5,000 on PyPI