Resource-aware Python
Know your resources.
Admit work with confidence.¶
Observe local resources, estimate workload capacity, and coordinate bounded work with an async-first library that fits into your application.
From observations to decisions¶
RESOURCERA combines established system telemetry with conservative, explainable resource reasoning. Use the pieces you need without adopting a framework.
-
See what's available
Inspect CPU, memory, disk, network, containers, and visible accelerators with explicit status, source, and freshness.
-
Estimate capacity
Describe the resources a workload needs and see which dimension limits concurrency, including when a required measurement is unknown.
-
Admit bounded work
Make explainable admission decisions, keep a lease while work runs, and handle rejection or finite waiting explicitly.
-
Coordinate locally
Share logical reservations in one interpreter or among cooperating processes on the same machine.
A small, async-first API¶
Create a manager, inspect a snapshot, and protect the lifetime of your work:
import anyio
from resourcera import AdmissionRejectedError, ResourceManager
async def main():
async with ResourceManager() as resources:
snapshot = await resources.snapshot()
print("Memory status:", snapshot.memory.available_bytes.status)
try:
async with resources.admission({"memory": "64MiB"}) as decision:
print("Admitted:", decision.lease_id)
await anyio.sleep(0.01)
except AdmissionRejectedError as error:
print("Not admitted:", error.decision.reason)
anyio.run(main)
Built around clear boundaries¶

Measurements are observations, not promises. Unknown or stale required data is not free capacity; logical reservations do not provide physical isolation. Explore the architecture, sampling and overhead, and accelerator limitations for the details.
Downloads¶
Download data comes from the public ClickHouse PyPI dataset, which refreshes daily, so counts can be about a day behind. Shields caches badge images for up to an hour, and GitHub may cache them longer. Weeks start on Monday in UTC. Country groups without downloads are omitted and need a documentation update if they become active. Explore interactive charts on the ClickPy dashboard.
Find your next step¶
-
Start building
-
Go deeper
-
Work with coding agents