sqlalchemy-repr
Automatically generates pretty repr of a SQLAlchemy model.
What it is and what it does
sqlalchemy-repr is a mixin library that automatically generates readable string representations of SQLAlchemy model instances. It provides two base classes: RepresentableBase for compact single-line repr output, and PrettyRepresentableBase for indented multi-line formatting. You use it by passing one of these classes to declarative_base() when defining your SQLAlchemy models, and then print() or repr() on model instances will display their column values in a formatted way instead of the default object address.
The package has no runtime dependencies and is lightweight, but it is dormant—the last release was in October 2022, over a year ago. It was originally released in 2016 and supports Python 2.7 through 3.10 according to its classifiers, though real-world compatibility with current SQLAlchemy and Python versions is unverified. The license is unclear, which is a significant risk for adoption.
Use it for:
- Debug SQLAlchemy model instances during development by printing readable column data instead of object addresses.
- Log model state in application logs with compact or pretty-printed representations for troubleshooting.
- Display model objects in REPL sessions or test output for easier inspection of database records.
- Generate human-friendly string output for model instances in error messages or validation reports.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds automatic, human-readable repr() output to SQLAlchemy model instances by providing mixin base classes that format column data for display.
No—install friction is high due to dormancy (last release October 2022), and the license is unclear, creating legal risk. The package solves a minor problem (repr formatting) that modern SQLAlchemy and Python debugging tools often handle adequately. Only consider it if you have an existing codebase already using it and need to maintain it; do not adopt it in new projects.
Install
sqlalchemy-repr on PyPI
pip
pip install sqlalchemy-repruv
uv add sqlalchemy-reprpoetry
poetry add sqlalchemy-reprInstalling sqlalchemy-repr
Before you install
High install friction: the package has no runtime dependencies but is marked as dormant (last release 2022-10-20, 1394 days old). Maintenance status suggests limited ongoing support.
License in practice
License treatment is unclear—no SPDX identifier or raw license text is available. Verify the actual license before adopting in a commercial or copyleft-sensitive context.
Quickstart
pip install sqlalchemy-repr
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy_repr import RepresentableBase
Base = declarative_base(cls=RepresentableBase)
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
name = Column(Unicode(255))
user = User(name='example')
print(user) # Automatic repr output
Verify before relying
- Actual license text or SPDX identifier—license_treatment is 'unclear' and no raw license is provided.
- Compatibility with recent SQLAlchemy versions (1.4+, 2.0+)—last release was 2022-10-20.
- Whether the package works with modern Python 3.10+ in practice despite classifier claims.
Package facts
| License | not declared (unclear) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | dormant — 1,394 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 107,775/month — #12,596 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sqlalchemy-repr-0.1.0.tar.gz
Keywords: pprint, pretty, print, repr, sqlalchemy, extension
Tags
More Front-Ends packages
SQLAlchemy is a Python SQL toolkit and Object…
permissive · top 100 on PyPI
psycopg2-binarypsycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
alembicAlembic generates and manages database schema…
permissive · top 1,000 on PyPI
weaviate-clientA Python client library for connecting to and…
permissive · top 1,000 on PyPI
databricks-sql-connectorA Python client library that connects to…
permissive · top 1,000 on PyPI
psycopgPsycopg 3 is a PostgreSQL database adapter for…
copyleft · top 1,000 on PyPI
SQLAlchemy-ContinuumSQLAlchemy-Continuum adds automatic versioning…
permissive · top 5,000 on PyPI
sqladminGenerates a web-based admin interface for…
permissive · top 5,000 on PyPI
sqlalchemy-easy-softdeleteAdds soft-deletion support to SQLAlchemy models…
permissive · top 15,000 on PyPI
sqlacodegenReads an existing database schema and generates…
permissive · top 5,000 on PyPI
marshmallow-sqlalchemyGenerates marshmallow schemas from SQLAlchemy…
permissive · top 5,000 on PyPI
databricks-sqlalchemyProvides a SQLAlchemy 2.0 dialect that bridges…
permissive · top 1,000 on PyPI
sqlalchemy-spannerProvides a SQLAlchemy dialect that enables…
permissive · top 5,000 on PyPI
duckdb-engineA SQLAlchemy driver that enables you to use…
permissive · top 5,000 on PyPI
cheap-reprProvides short, fast, configurable string…
permissive · top 15,000 on PyPI
renewGenerates reproducible string representations…
permissive · top 15,000 on PyPI