oslo.context
Oslo Context library
Decision gist · record as of 2026-08-14
Yes, if you're building a WSGI application that needs to propagate request metadata (IDs, user info) across your codebase without explicit parameter passing. Low install friction, active maintenance, no known vulnerabilities, and permissive licensing make it a safe choice. Not necessary for simple scripts or applications that don't need request-scoped context.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.11 or later.
- Low friction: pure Python wheel, only two lightweight runtime dependencies (pbr and typing-extensions).
- Active maintenance with a release 35 days ago.
License · maintenance · safety
Apache-2.0 (permissive) — Apache License 2.0 (permissive): you can use, modify, and distribute this package freely in commercial and private projects, provided you include the license notice.
last release 2026-07-10 (35 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 988,879 downloads/mo, #4,568 on PyPI
Alternatives
Verify before relying
pip install oslo.context
from oslo_context import context
ctx = context.RequestContext(user='alice', project='myproject')
context.set_ctx(ctx)
request_id = context.get_current().request_id- Whether oslo.context integrates automatically with WSGI frameworks or requires manual middleware setup.
- What specific request metadata fields are available beyond user and project identifiers.
What it is and what it does
oslo.context is a small library from the OpenStack project that helps you store and retrieve request-scoped metadata—such as request IDs, user identifiers, and project names—in a way that's accessible throughout your application without passing context as a function parameter. It's typically used in WSGI applications to populate context in the middleware layer, then accessed by logging and other modules downstream.
The library uses thread-local (or async-context-aware) storage to keep request data isolated between concurrent requests. It's designed as a utility for larger OpenStack-based systems but can be used standalone in any Python application that needs to track request metadata across function call boundaries.
Use it for
- Store and retrieve request IDs in WSGI middleware to correlate logs across service calls.
- Maintain user and project identifiers in context for access control checks in business logic.
- Populate logging formatters with request metadata without threading context through every function.
- Track request-scoped data in OpenStack services and compatible cloud applications.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you're building a WSGI application that needs to propagate request metadata (IDs, user info) across your codebase without explicit parameter passing.
Low install friction, active maintenance, no known vulnerabilities, and permissive licensing make it a safe choice. Not necessary for simple scripts or applications that don't need request-scoped context.
Install
oslo-context on PyPI
Before you install
Low friction: pure Python wheel, only two lightweight runtime dependencies (pbr and typing-extensions). Active maintenance with a release 35 days ago. Requires Python 3.11 or later.
Requires Python 3.11 or later.
License in practice
Apache License 2.0 (permissive): you can use, modify, and distribute this package freely in commercial and private projects, provided you include the license notice.
Quickstart
pip install oslo.context
from oslo_context import context
ctx = context.RequestContext(user='alice', project='myproject')
context.set_ctx(ctx)
request_id = context.get_current().request_id
Verify before relying
- Whether oslo.context integrates automatically with WSGI frameworks or requires manual middleware setup.
- What specific request metadata fields are available beyond user and project identifiers.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.11 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagespbrtyping-extensions |
| Maintenance | Actively maintained 35 days since the last release |
| First released | |
| Downloads | 988,879 / month, #4,568 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Environment :: OpenStackIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonTyping :: Typed |
Evidence: oslo_context-6.5.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “request context management”
- oslo.contextoslo.context provides utilities to store and access request context…
- vercel-headersRegisters and exposes request headers for Vercel Python functions,…
- opentracingProvides the OpenTracing API for Python, enabling distributed tracing…
Give your agent the search over MCP, or paste the wish link into any chat.
More Application Frameworks packages
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Textual is a Python framework for building cross-platform user interfaces that run in the terminal or web browser using a modern, component-based API.
Install it if you're developing CLI tools, dashboards, or interactive terminal applications.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Build and connect to Model Context Protocol servers that expose tools, resources, and prompts to LLM applications over stdio, HTTP, or SSE transports.
Install it if you need to build or connect to servers.
Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.
See also oslo.middleware · oslo.utils · oslo.service · oslo.log · oslo.db · oslo.policy · oslo.config · oslo.vmware · oslo.i18n · microversion-parse