records
SQL for Humans
What it is and what it does
Records is a minimal SQL query wrapper built on SQLAlchemy and Tablib that lets you execute raw SQL against relational databases and work with results as Python objects. It supports Postgres, MySQL, SQLite, Oracle, RedShift, and MS-SQL through SQLAlchemy's driver ecosystem, and returns rows as Record objects accessible by attribute name, dictionary key, or index position.
The package is designed for developers who prefer writing SQL directly rather than using an ORM. Beyond basic querying, it includes transaction support, parameterized queries, bulk operations, and integration with Tablib for exporting results to CSV, JSON, YAML, XLS, XLSX, or Pandas DataFrames. A command-line tool is also available for ad-hoc query export.
Use it for:
- Export database query results to CSV, JSON, or Excel for reporting or data sharing.
- Execute raw SQL queries and iterate over results without ORM overhead in data pipelines.
- Build command-line tools that query databases and format output in multiple formats.
- Access query results flexibly by column name, index, or dictionary key in the same workflow.
- Run parameterized queries safely against multiple database backends with a single API.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Records provides a lightweight SQL query interface for relational databases, letting you write raw SQL and access results as objects with attribute, dictionary, and index-based access.
Yes, if you prefer writing SQL directly and need a lightweight result wrapper with export capabilities. The permissive license, low install friction, and stable API make it a reasonable choice for simple query workflows. However, the aging maintenance status (868 days since last release) means you should verify compatibility with your specific database drivers and Python version before committing to production use.
Install
records on PyPI
pip
pip install recordsuv
uv add recordspoetry
poetry add recordsInstalling records
Before you install
Low install friction with a pure-Python wheel and four runtime dependencies. Maintenance is aging—last release was 868 days ago—but the repository remains active and the package is marked Production/Stable with 7220 GitHub stars.
License in practice
Licensed under ISC (permissive), allowing free use, modification, and distribution with minimal restrictions.
Quickstart
import records
db = records.Database('postgres://user:pass@localhost/dbname')
rows = db.query('SELECT * FROM users')
for row in rows:
print(row.name, row.email)
Requires a database driver for your target database (e.g., psycopg2 for PostgreSQL, mysql-connector-python for MySQL); Records itself does not include drivers.
Verify before relying
- Whether the aging maintenance status (last release 868 days ago) affects compatibility with recent database driver versions.
- Performance characteristics for large result sets compared to other query libraries.
Package facts
| License | ISC (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — SQLAlchemy, tablib, openpyxl, docopt |
| Maintenance | aging — 868 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 268,909/month — #8,266 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: records-0.6.0-py2.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
ipython-sqlAdds SQL magic commands to IPython and Jupyter…
permissive · top 15,000 on PyPI
SQLAlchemySQLAlchemy is a Python SQL toolkit and Object…
permissive · top 100 on PyPI
datasetdataset simplifies reading and writing data to…
permissive · top 5,000 on PyPI
agate-sqlagate-sql extends the agate data analysis…
permissive · top 15,000 on PyPI
django-postgres-copyProvides Django ORM integration for…
permissive · top 5,000 on PyPI
mssqlWraps SQLAlchemy and pyodbc to simplify…
permissive · top 15,000 on PyPI
sqlalchemy-solrProvides a SQLAlchemy dialect that allows you…
permissive · top 15,000 on PyPI
tablibTablib converts tabular data between multiple…
permissive · top 5,000 on PyPI
DrissionRecordBuffers and writes data to files (xlsx, csv,…
permissive · top 15,000 on PyPI
recordlinkageRecordLinkage identifies and matches records…
permissive · top 5,000 on PyPI