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.

Project

Metadata

Release files for resourcera 0.2.1

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.1
File Size Uploaded Provenance Actions
resourcera-0.2.1.tar.gz 806.4 kB Without provenance Details for resourcera-0.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 878.5 kB

Release files / resourcera-0.2.1.tar.gz

Download URL resourcera-0.2.1.tar.gz
Size 806.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3d2d198564a652d1506f161276a09f349c89ae0d788dafcea1989a2fd7c02aa2
BLAKE2b-256 checksum
How to use checksums
d6b7c4ab8d43847109962e578e94d0684df1b08167e8affaa76479ffedcf752e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","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.1-py3-none-any.whl

Download URL resourcera-0.2.1-py3-none-any.whl
Size 72.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
180c5bd33ddd873134c1b0425a39877597933458387b4a1f768572748fcd5a7b
BLAKE2b-256 checksum
How to use checksums
2eebe68c30319ce27ca7819c0da93fddf0eeaab1a9de80d10c78ba89c596f6f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","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.1

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