skillfed

sqlalchemy-repr

Automatically generates pretty repr of a SQLAlchemy model.

sqlalchemy-repr v0.1.0 107.8K downloads/30d#12,596 on PyPI37
License unclear DORMANT released

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-repr

uv

uv add sqlalchemy-repr

poetry

poetry add sqlalchemy-repr

Installing 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

Development Status :: 4 - BetaOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Database :: Front-Ends

Tags

sqlalchemy model reprpretty print sqlalchemy objectssqlalchemy object representationsqlalchemy debug outputsqlalchemy model string formattingsqlalchemy column displaysqlalchemy repr mixin
sqlalchemy-extensiondebugging

More Front-Ends packages

SQLAlchemy

SQLAlchemy is a Python SQL toolkit and Object…

permissive · top 100 on PyPI

psycopg2-binary

psycopg2-binary is a PostgreSQL database…

copyleft · top 1,000 on PyPI

alembic

Alembic generates and manages database schema…

permissive · top 1,000 on PyPI

weaviate-client

A Python client library for connecting to and…

permissive · top 1,000 on PyPI

databricks-sql-connector

A Python client library that connects to…

permissive · top 1,000 on PyPI

psycopg

Psycopg 3 is a PostgreSQL database adapter for…

copyleft · top 1,000 on PyPI

SQLAlchemy-Continuum

SQLAlchemy-Continuum adds automatic versioning…

permissive · top 5,000 on PyPI

sqladmin

Generates a web-based admin interface for…

permissive · top 5,000 on PyPI

sqlalchemy-easy-softdelete

Adds soft-deletion support to SQLAlchemy models…

permissive · top 15,000 on PyPI

sqlacodegen

Reads an existing database schema and generates…

permissive · top 5,000 on PyPI

marshmallow-sqlalchemy

Generates marshmallow schemas from SQLAlchemy…

permissive · top 5,000 on PyPI

databricks-sqlalchemy

Provides a SQLAlchemy 2.0 dialect that bridges…

permissive · top 1,000 on PyPI

sqlalchemy-spanner

Provides a SQLAlchemy dialect that enables…

permissive · top 5,000 on PyPI

duckdb-engine

A SQLAlchemy driver that enables you to use…

permissive · top 5,000 on PyPI

cheap-repr

Provides short, fast, configurable string…

permissive · top 15,000 on PyPI

renew

Generates reproducible string representations…

permissive · top 15,000 on PyPI