greenlet
Lightweight in-process concurrent programming
Decision gist · record as of 2026-08-14
Yes, if you need lightweight coroutines for custom concurrency patterns or are building a framework that depends on greenlets. The package is stable, actively maintained, permissively licensed, and widely used. Install friction is moderate due to C compilation, but prebuilt wheels cover most platforms. Not necessary if you're satisfied with asyncio or threading for your use case.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; compiled C extension wheels are provided for most platforms but source compilation may be needed on uncommon architectures.
- Medium install friction due to compiled C extension wheels, but well-maintained with active development (last commit 2026-08-10) and broad platform coverage across Linux, macOS, and Windows architectures for Python 3.10+.
License · maintenance · safety
MIT AND PSF-2.0 (permissive) — Dual-licensed under MIT and PSF-2.0 (permissive); both are business-friendly and impose no restrictions on use, modification, or distribution in proprietary or open-source projects.
last release 2026-08-10 (4 days) · last repo commit 2026-08-10 · 1,837 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 476,388,596 downloads/mo, #85 on PyPI
Alternatives
Verify before relying
pip install greenlet
from greenlet import greenlet
def test1():
print("test1")
gr2.switch()
print("test1 again")
def test2():
print("test2")
gr1.switch()
gr1 = greenlet(test1)
gr2 = greenlet(test2)
gr1.switch()- Whether greenlet integrates seamlessly with modern async/await syntax or requires explicit scheduling glue code.
- Performance characteristics and memory overhead compared to asyncio or threading for typical workloads.
- Compatibility with popular frameworks (Gevent, Eventlet) beyond the documented spin-off relationship.
What it is and what it does
Greenlet is a C extension that implements lightweight coroutines—micro-threads with no implicit scheduling—for concurrent programming within a single Python process. Unlike OS-level threads, greenlets are cheap to create and context-switch, making them suitable for building custom concurrency patterns. You control exactly when code runs by explicitly switching between greenlets, giving you fine-grained control over execution flow.
The package is a foundational building block used by higher-level concurrency libraries like Gevent and Eventlet. It has no runtime dependencies and works across Python 3.10+ on Linux, macOS, Windows, and other platforms. The dual MIT/PSF-2.0 license is permissive, and the project is actively maintained with broad adoption (top 100 PyPI packages by downloads).
Use it for
- Build custom schedulers or event loops where you need explicit control over when each coroutine runs.
- Implement advanced control flow structures like generators that can yield from nested function calls.
- Provide a foundation for higher-level concurrency frameworks that wrap greenlets with scheduling and synchronization.
- Prototype concurrent algorithms without the complexity of OS threads or async/await syntax.
- Integrate with libraries like Gevent or Eventlet that depend on greenlets for their concurrency model.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need lightweight coroutines for custom concurrency patterns or are building a framework that depends on greenlets.
The package is stable, actively maintained, permissively licensed, and widely used. Install friction is moderate due to C compilation, but prebuilt wheels cover most platforms. Not necessary if you're satisfied with asyncio or threading for your use case.
Install
greenlet on PyPI
Before you install
Medium install friction due to compiled C extension wheels, but well-maintained with active development (last commit 2026-08-10) and broad platform coverage across Linux, macOS, and Windows architectures for Python 3.10+.
Requires Python 3.10 or later; compiled C extension wheels are provided for most platforms but source compilation may be needed on uncommon architectures.
License in practice
Dual-licensed under MIT and PSF-2.0 (permissive); both are business-friendly and impose no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
pip install greenlet
from greenlet import greenlet
def test1():
print("test1")
gr2.switch()
print("test1 again")
def test2():
print("test2")
gr1.switch()
gr1 = greenlet(test1)
gr2 = greenlet(test2)
gr1.switch()
Verify before relying
- Whether greenlet integrates seamlessly with modern async/await syntax or requires explicit scheduling glue code.
- Performance characteristics and memory overhead compared to asyncio or threading for typical workloads.
- Compatibility with popular frameworks (Gevent, Eventlet) beyond the documented spin-off relationship.
Package facts
| License | MIT AND PSF-2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 4 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 476,388,596 / month, #85 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: CProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Topic :: Software Development :: Libraries :: Python Modules |
Evidence: greenlet-3.5.5-cp310-cp310-macosx_11_0_universal2.whl; greenlet-3.5.5-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; greenlet-3.5.5-cp310-cp310-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl; greenlet-3.5.5-cp310-cp310-manylinux_2_24_s390x.manylinux_2_28_s390x.whl; greenlet-3.5.5-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; greenlet-3.5.5-cp310-cp310-manylinux_2_39_riscv64.whl; greenlet-3.5.5-cp310-cp310-musllinux_1_2_aarch64.whl; greenlet-3.5.5-cp310-cp310-musllinux_1_2_x86_64.whl; greenlet-3.5.5-cp310-cp310-win_amd64.whl; greenlet-3.5.5-cp311-cp311-macosx_11_0_universal2.whl; greenlet-3.5.5-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; greenlet-3.5.5-cp311-cp311-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl; greenlet-3.5.5-cp311-cp311-manylinux_2_24_s390x.manylinux_2_28_s390x.whl; greenlet-3.5.5-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; greenlet-3.5.5-cp311-cp311-manylinux_2_39_riscv64.whl; greenlet-3.5.5-cp311-cp311-musllinux_1_2_aarch64.whl; greenlet-3.5.5-cp311-cp311-musllinux_1_2_x86_64.whl; greenlet-3.5.5-cp311-cp311-win_amd64.whl; greenlet-3.5.5-cp311-cp311-win_arm64.whl; greenlet-3.5.5-cp312-cp312-macosx_11_0_universal2.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “lightweight coroutines python”
- greenletGreenlet provides lightweight coroutines for concurrent programming…
- syncerSyncer converts async functions to synchronous callables, allowing…
- aiolimiterImplements a rate limiter for asyncio using the leaky bucket…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also eventlet · gevent · greenback · grequests · xlocal · mode-streaming · types-greenlet · psycogreen · threadloop · multitasking