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 a checkout:

python -m pip install .

The intended distribution name is resourcera once a release is published. For optional NVIDIA NVML telemetry, install .[nvidia] from a checkout and provide a compatible driver and NVML library. 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.

Project

Metadata

Release files for resourcera 0.2.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.2.0
File Size Uploaded Provenance Actions
resourcera-0.2.0.tar.gz 1.2 MB Without provenance Details for resourcera-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 1.2 MB

Release files / resourcera-0.2.0.tar.gz

Download URL resourcera-0.2.0.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
87c3e3210e03ff762bd55ddb66d1532e29c058fcadd46cfff19bf73aca2b8d1b
BLAKE2b-256 checksum
How to use checksums
91de84e04e0c8dedad7d674c85b4878558dc1f27ac2bb5535a6e2a8812bd2d80
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.2.0-py3-none-any.whl

Download URL resourcera-0.2.0-py3-none-any.whl
Size 72.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d21c9227c52c7e83cc80d4313af486b0ebd4a0c6cef20e9c0fd2ac40a0acd27
BLAKE2b-256 checksum
How to use checksums
fa1059f7b12400f7e736fbe6b101dcaf389117bbf74b91d0398cedd559375112
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.2.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