oslo.db
Oslo Database library
What it is and what it does
oslo.db is an OpenStack library that abstracts database connectivity and provides common patterns for ORM-based applications. It wraps SQLAlchemy and alembic to offer a unified interface for database operations across different backends, handling session management, migrations, and helper utilities that OpenStack services rely on.
The library is production-stable and actively maintained, with support for Python 3.11, 3.12, 3.13, and 3.14. It's primarily designed for OpenStack projects but can be used by any application needing structured database abstraction with alembic-based schema management. Its runtime dependencies are well-established libraries (SQLAlchemy, alembic, oslo.config, stevedore), making it a straightforward addition to projects already using those tools.
Use it for:
- Building OpenStack services that need consistent database connectivity patterns and schema versioning.
- Abstracting database backend differences in multi-tenant or multi-database applications using SQLAlchemy.
- Managing database migrations in large projects via alembic with oslo.db's helper utilities.
- Implementing session and connection pooling strategies for OpenStack-compatible applications.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
oslo.db provides database connectivity and ORM utilities for OpenStack applications, abstracting backend differences and offering migration, session management, and database helper functions.
Yes, if you are building OpenStack services or applications that benefit from its database abstraction patterns. The library is production-stable, actively maintained, has low install friction, and carries a permissive Apache-2.0 license. No known security vulnerabilities. Install only if you need its specific patterns; it is not a general-purpose ORM replacement.
Install
oslo-db on PyPI
pip
pip install oslo-dbuv
uv add oslo-dbpoetry
poetry add oslo-dbInstalling oslo.db
Before you install
Low install friction with a pure-Python wheel distribution. Active maintenance with a release 35 days ago. Depends on well-established libraries including SQLAlchemy, alembic, and oslo.config.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most deployment contexts.
Quickstart
pip install oslo.db
from oslo_db.sqlalchemy import models
from sqlalchemy import Column, String
class MyModel(models.ModelBase):
name = Column(String)
Requires Python 3.11 or later; SQLAlchemy must be installed and configured with a supported database backend.
Verify before relying
- Specific database backends supported and any version constraints for each.
- Whether oslo.db is required for non-OpenStack projects or primarily intended for OpenStack ecosystem use.
- Performance characteristics or scalability limits for high-throughput database operations.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 9 — alembic, debtcollector, oslo.i18n, oslo.config, oslo.utils, SQLAlchemy, stevedore, testresources, testscenarios |
| Maintenance | actively maintained — 35 days since the last release |
| First released | |
| Downloads | 467,937/month — #6,496 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: oslo_db-18.1.0-py3-none-any.whl
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
oslo.upgradecheckProvides a framework for writing and running…
permissive · top 15,000 on PyPI
oslo.vmwareoslo.vmware provides a library for common…
permissive · top 15,000 on PyPI
oslo.cacheoslo.cache wraps dogpile.cache to provide a…
permissive · top 15,000 on PyPI
oslo.logoslo.log provides standardized logging…
permissive · top 5,000 on PyPI
oslo.messagingOslo Messaging provides a unified API for RPC…
permissive · top 15,000 on PyPI
oslo.serviceoslo.service provides a framework for building…
permissive · top 15,000 on PyPI
oslo.configParses command-line arguments and .ini-style…
permissive · top 5,000 on PyPI
oslo.middlewareoslo.middleware provides WSGI middleware…
permissive · top 15,000 on PyPI
oslo.policyoslo.policy enforces role-based access control…
permissive · top 15,000 on PyPI
oslotestoslotest provides a testing framework with…
permissive · top 15,000 on PyPI