schemainspect
Schema inspection for PostgreSQL (and possibly others)
Decision gist · record as of 2026-08-14
Yes, if you need to inspect a PostgreSQL schema programmatically. The package is dormant but stable, has no vulnerabilities, and installs cleanly with only sqlalchemy as a dependency. The main caveat is that it is no longer actively maintained; if you encounter bugs or need support for new PostgreSQL features, you may need to fork or patch it yourself.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a running PostgreSQL database and a valid connection string; psycopg2 (PostgreSQL driver) must be installed separately or via the [pg] extra.
- Low install friction with a single runtime dependency on sqlalchemy.
- The package is dormant (last release 2022-09-19, last commit 2024-05-14), so maintenance is not active, but the repository remains public and unarchived.
License · maintenance · safety
Unlicense (permissive) — Licensed under the Unlicense (permissive), which places the work in the public domain with minimal restrictions on use or modification.
last release 2022-09-19 (1425 days) · last repo commit 2024-05-14 · 53 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 247,944 downloads/mo, #8,680 on PyPI
Alternatives
Verify before relying
from schemainspect import get_inspector
from sqlalchemy import create_engine
engine = create_engine('postgresql://user:password@localhost/dbname')
with engine.connect() as conn:
inspector = get_inspector(conn)
books = inspector.tables['"public"."books"']
print(books.name, [col.name for col in books.columns])- Whether function inspection works reliably with languages other than SQL/PLPGSQL despite the stated limitation.
- Current state of support for database systems other than PostgreSQL, given the 'potentially others in the future' language in the description.
What it is and what it does
Schemainspect is a Python library that reads the structure of a PostgreSQL database and exposes it as Python objects through a SQLAlchemy connection. It introspects tables, views, materialized views, constraints, indexes, sequences, enums, functions, and extensions, including support for table partitioning and inheritance. You pass it an open SQLAlchemy session or connection and receive an inspector object with dictionary-like attributes mapping fully-qualified database object names to information objects.
The library is designed for developers who need programmatic access to database schema metadata—for instance, to generate documentation, validate schema changes, or build schema-aware tools. It depends only on sqlalchemy and installs with low friction. The package is dormant but stable; it has no known vulnerabilities and supports Python 3.7 through 3.10.
Use it for
- Extract table and column metadata from a PostgreSQL database to generate schema documentation or diagrams.
- Validate database schema changes by comparing inspector snapshots before and after migrations.
- Build schema-aware code generators or ORM mappers that need to introspect the live database structure.
- Audit database objects like functions, constraints, and indexes programmatically in a Python application.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to inspect a PostgreSQL schema programmatically.
The package is dormant but stable, has no vulnerabilities, and installs cleanly with only sqlalchemy as a dependency. The main caveat is that it is no longer actively maintained; if you encounter bugs or need support for new PostgreSQL features, you may need to fork or patch it yourself.
Install
schemainspect on PyPI
Before you install
Low install friction with a single runtime dependency on sqlalchemy. The package is dormant (last release 2022-09-19, last commit 2024-05-14), so maintenance is not active, but the repository remains public and unarchived.
Requires a running PostgreSQL database and a valid connection string; psycopg2 (PostgreSQL driver) must be installed separately or via the [pg] extra.
License in practice
Licensed under the Unlicense (permissive), which places the work in the public domain with minimal restrictions on use or modification.
Quickstart
from schemainspect import get_inspector
from sqlalchemy import create_engine
engine = create_engine('postgresql://user:password@localhost/dbname')
with engine.connect() as conn:
inspector = get_inspector(conn)
books = inspector.tables['"public"."books"']
print(books.name, [col.name for col in books.columns])
Verify before relying
- Whether function inspection works reliably with languages other than SQL/PLPGSQL despite the stated limitation.
- Current state of support for database systems other than PostgreSQL, given the 'potentially others in the future' language in the description.
Package facts
| License | Unlicense permissive |
| Python support | Supports the current Python release >=3.7,<4 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagesqlalchemy |
| Maintenance | Dormant 1,425 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 247,944 / month, #8,680 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: Other/Proprietary LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: schemainspect-3.1.1663587362-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 › “postgresql schema inspection”
- schemainspectInspects PostgreSQL database schemas to extract metadata about…
- pysqlsyncSynchronize database schemas and bulk-load data using Python…
- tentaclio-postgresBundles PostgreSQL connectivity and schema support for the tentaclio…
Give your agent the search over MCP, or paste the wish link into any chat.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also sqlalchemy-diff · alembic_utils · migra · sqlalchemy-views · django-pgviews-redux · postgres · pglast · sqlacodegen · django-postgres-extra · django-tenants