Registry / devops / oslo-limit

oslo-limit

JSON →
library2.11.0pypypi✓ verified 83d ago

Limit enforcement library to assist with quota calculation, part of the OpenStack Oslo project. Current version 2.10.0, requires Python >=3.10. Maintenance mode with infrequent releases.

pip install oslo.limit
INSTALL
IMPORT
SIG · OSLO-LIMIT
O
oslo-limit
devopspythonv2.11.0
Install
7.9s avg
Import
1814ms
Disk
92MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.11.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 1.886s · 84.5MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 7.9s · import 1.742s · 86MB
92MB installed
● package 92MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Limit
from oslo_limit import limit
from oslo.limit import limit
Correct package is oslo_limit, not oslo.limit.
Enforcer
from oslo_limit import limit; enforcer = limit.Enforcer(...)
from oslo.limit import enforcer
Enforcer is accessed via the limit module.

Basic usage: create an Enforcer and call enforce() to check quota limits.

from oslo_limit import limit # Define a resource with a limit of 10 resource = {'name': 'instances', 'limit': 10} # Check usage enforcer = limit.Enforcer() # Would raise exception if exceeded enforcer.enforce('project-id', resource, usage=5)
Debug
Known issues
breakingVersion 2.0.0 dropped Python 2 support and changed the API to be async-only. Synchronous usage will break.
fix
Update code to use async/await; see migration guide in documentation.
affects: >=2.0.0
deprecatedThe 'limit.Limit' class is deprecated in favor of using the Enforcer directly.
fix
Use limit.Enforcer instead of instantiating limit.Limit.
affects: 2.5.0 and later
gotchaResource names are case-sensitive and must match exactly the names used in the backend.
fix
Always use consistent casing for resource names (e.g., 'instances' not 'Instances').
affects: All
Errors
Common errors & fixes
ImportError: No module named oslo.limit
Using wrong import path; the correct package is oslo_limit.
fix
Run: pip install oslo.limit
Then import: from oslo_limit import limit
TypeError: object Enforcer can't be used in 'await' expression
Enforcer methods are async and must be awaited.
fix
Use: await enforcer.enforce(...) inside an async function.
oslo_limit.limit.ResourceNotFound: Resource 'instances' not found
Resource name is not registered or case mismatch.
fix
Verify resource names are registered in the backend and use exact case (e.g., 'instances' vs 'Instances').
Upgrade
Version history
2.11.0latest on PyPI · released May 18, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
oslo-limit — pip install oslo-limit · libregistry