Records is a Python library designed to make direct SQL querying convenient without introducing a full object-relational mapper. It supports relational databases including PostgreSQL, MySQL, SQLite, Oracle, Microsoft SQL Server, and Amazon Redshift through SQLAlchemy. Query results are exposed as friendly Record objects whose fields can be accessed by attribute, key, or numeric index. Queries support safe parameterization, SQL files, transactions, and bulk operations. Result collections can be converted into dictionaries or exported through Tablib to formats such as CSV, JSON, Excel, HTML, YAML, and Pandas DataFrames. A command-line utility allows SQL queries and exports to be performed outside Python code. The library focuses on keeping raw SQL workflows concise and readable.
Features
- Direct raw SQL querying
- Multiple relational database backends
- Attribute, key, and index-based row access
- Parameterized queries and transactions
- CSV, JSON, Excel, YAML, and DataFrame export
- Command-line SQL query and export tools