Skip to main content

RESOURCERA resource gauge logo

RESOURCERA

Know your resources. Admit work with confidence.
Resource intelligence, capacity estimation, and resource-aware concurrency for Python applications.

CI status Documentation status Python 3.12, 3.13, 3.14 and 3.15 Typed package Apache License 2.0 Asyncio and Trio supported

Documentation · Quickstart · Examples · Agent skills · Contributing


RESOURCERA is an embeddable, async-first library that observes local resources, estimates capacity for a workload, and helps cooperating application tasks make explainable admission decisions. It is framework-neutral and does not require an accelerator SDK.

What you can do

Capability How it helps
Observe Inspect CPU, memory, disk, network, container limits, and visible accelerators with explicit freshness and capability states.
Estimate Describe workload requirements and identify the limiting resource without treating missing data as free capacity.
Admit Bound concurrent work with explainable acceptance or rejection and optional finite waiting.
Adapt Replace hardcoded semaphores, limiters, and thread-pool sizes with resource-derived, self-adjusting concurrency limits.
Coordinate Hold logical leases within an interpreter or between cooperating processes on one machine.
Control overhead Use bounded, adaptive sampling with observable self-overhead safeguards.

RESOURCERA is not a dashboard, distributed execution engine, or physical resource isolation mechanism. Measurements and estimates are observations, not guarantees.

Installation

Python 3.12, 3.13, 3.14, and 3.15 are supported (3.12 or newer is required). Install from PyPI:

python -m pip install resourcera

For optional NVIDIA NVML telemetry, install resourcera[nvidia] and provide a compatible driver and NVML library. To install from a checkout, use python -m pip install .. RESOURCERA never installs SDKs or drivers.

Quickstart

import anyio

from resourcera import AdmissionRejectedError, ResourceManager


async def main():
    async with ResourceManager(scope="machine") as resources:
        snapshot = await resources.snapshot()
        print("Available memory:", snapshot.memory.available_bytes.value, "bytes")

        try:
            async with resources.admission({"memory": "64MiB"}) as decision:
                print("Admitted:", decision.lease_id)
                await anyio.sleep(0.01)  # Your workload goes here.
        except AdmissionRejectedError as error:
            print("Not admitted:", error.decision.reason)


anyio.run(main)

The manager owns its sampling and lease lifecycle. CPU and throughput rates need two samples; unavailable, stale, or failed required measurements reject admission. Keep the admission context open while the work runs.

Adaptive concurrency

Instead of asyncio.Semaphore(100) or ThreadPoolExecutor(max_workers=10), let capacity decide:

async with resources.adaptive_concurrency(
    {"cpu": 0.5, "memory": "256MiB"}, max_concurrency=50
) as controller:
    async with controller.slot():
        await do_work()

recommendation = await resources.recommend_concurrency(
    {"memory": "64MiB", "profile": "io-bound"}, max_concurrency=32
)
executor = ThreadPoolExecutor(max_workers=recommendation.recommended_limit)

Each slot holds a real lease. Limits fall immediately when capacity drops and rise cautiously, and unknown capacity is never treated as unlimited. See the adaptive concurrency guide.

How it fits together

RESOURCERA resource intelligence architecture

Start with the quickstart, then explore capacity estimates, admission, and coordination guarantees. Platform-specific accelerator capabilities and their limitations are described in the accelerator guide.

Agent skills

The repository includes two optional Agent Skills: resourcera for using the public API safely, and resourcera-provider for building isolated accelerator providers. They are instructions for compatible coding agents, not runtime dependencies. See the installation guide.

Downloads

Total downloads Downloads this week Downloads this month Downloads this year

Downloads by year Top five download countries Downloads in countries A Downloads in countries B Downloads in countries C Downloads in countries D Downloads in countries E Downloads in countries F Downloads in countries G Downloads in countries H Downloads in countries I Downloads in countries J Downloads in countries K Downloads in countries L Downloads in countries M Downloads in countries N-O Downloads in countries P Downloads in countries R Downloads in countries S Downloads in countries T Downloads in countries U-Y

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.

Project

Metadata

Release files for resourcera 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for resourcera 0.4.0
File Size Uploaded Provenance Actions
resourcera-0.4.0.tar.gz 873.8 kB Without provenance Details for resourcera-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for resourcera 0.4.0
File Interpreter ABI Platform Actions
resourcera-0.4.0-py3-none-any.whl Python 3 none any Details for resourcera-0.4.0-py3-none-any.whl

Total release size: 958.4 kB

Release files / resourcera-0.4.0.tar.gz

Download URL resourcera-0.4.0.tar.gz
Size 873.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0427a18c9f0c7578137e4b018eb81bdc1ec6deef47ee8e613a4f88d86ef90c1e
BLAKE2b-256 checksum
How to use checksums
761e1c4c516a03a4df6faee4598ac2983e21ad8d22f89e1eef8532ec8282abbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / resourcera-0.4.0-py3-none-any.whl

Download URL resourcera-0.4.0-py3-none-any.whl
Size 84.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aaa142babd4cb7ed1e9273d8e748fd30ea1ffb9713087129528405ae278353af
BLAKE2b-256 checksum
How to use checksums
efb52475e1e818c6fcc34e607ff54912e150f15b467b4c3076f9d33f40b3506e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for resourcera 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page