# kennethreitz/records

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/kennethreitz-records).**

7,217 stars · 564 forks · Python · ISC

## Links

- GitHub: https://github.com/kennethreitz/records
- Homepage: https://pypi.python.org/pypi/records/
- awesome-repositories: https://awesome-repositories.com/repository/kennethreitz-records.md

## Topics

`forhumans` `kennethreitz` `orm` `postgres` `python` `schemas` `sql` `sqlalchemy`

## Description

Records is a SQL database client designed for executing raw queries and managing result sets through a simplified interface. It provides a parameterized SQL executor to bind values to placeholders, ensuring safe data handling and preventing injection attacks, alongside a database transaction manager for grouping operations into atomic units.

The project includes a dedicated command-line interface for running database statements and exporting query results directly to local files. This tooling allows for the conversion of SQL result sets into multiple serialization formats, including CSV, JSON, YAML, and Excel.

The library covers a broad range of database interaction capabilities, including bulk data processing, result set manipulation through sorting and slicing, and the execution of SQL queries from files.

## Tags

### Data & Databases

- [Raw SQL Execution](https://awesome-repositories.com/f/data-databases/data-access-querying/data-access-abstraction/raw-sql-execution.md) — Executes database statements directly via a thin wrapper over the database driver to avoid abstraction overhead.
- [SQL Query Interfaces](https://awesome-repositories.com/f/data-databases/sql-query-interfaces.md) — Provides a simplified interface for executing raw SQL queries and managing database result sets.
- [Atomic Batch Commits](https://awesome-repositories.com/f/data-databases/bulk-data-operations/atomic-batch-operations/database-atomic-batches/atomic-batch-commits.md) — Groups multiple database mutations into a single atomic unit that either applies completely or rolls back entirely.
- [Dynamic Object Mapping](https://awesome-repositories.com/f/data-databases/column-mappings/result-set-labeling/dynamic-object-mapping.md) — Converts raw database rows into accessible objects with dynamic attribute access for easy data manipulation.
- [Database Transaction Managers](https://awesome-repositories.com/f/data-databases/database-management-systems/database-systems-management/connection-transaction-management/database-transaction-managers.md) — Provides a system for grouping multiple SQL operations into atomic units to ensure data integrity.
- [Database Transaction Management](https://awesome-repositories.com/f/data-databases/database-transaction-management.md) — Groups multiple operations into single atomic units that commit or roll back to ensure data integrity. ([source](https://github.com/kennethreitz/records/blob/master/README.md))
- [Multi-Format Serializers](https://awesome-repositories.com/f/data-databases/multi-format-serializers.md) — Transforms structured database result sets into interchangeable formats like CSV, JSON, YAML, and Excel.
- [Query Result Fetching](https://awesome-repositories.com/f/data-databases/query-result-fetching.md) — Provides structured ways to organize, access, and manipulate record sets returned from SQL executions. ([source](https://github.com/kennethreitz/records/search))
- [SQL Placeholder Bindings](https://awesome-repositories.com/f/data-databases/query-translators/placeholder-rebinders/sql-placeholder-bindings.md) — Binds values to placeholders in SQL statements to prevent injection attacks and ensure type safety.
- [SQL Query Execution](https://awesome-repositories.com/f/data-databases/sql-query-execution.md) — Runs raw SQL strings or files and returns results as iterable rows with flexible attribute access. ([source](https://github.com/kennethreitz/records/blob/master/README.md))
- [Parameterized Bulk Processing](https://awesome-repositories.com/f/data-databases/data-processing-tasks/bulk-data-processing/parameterized-bulk-processing.md) — Executes the same SQL query multiple times with different parameters to handle large datasets efficiently.
- [Query Result Exporters](https://awesome-repositories.com/f/data-databases/data-serialization-formats/structured-data-exporters/analysis-result-exporters/query-result-exporters.md) — Provides a command-line tool to execute queries and export results directly to local files. ([source](https://github.com/kennethreitz/records))
- [Result Set Refinements](https://awesome-repositories.com/f/data-databases/query-result-fetching/result-set-refinements.md) — Supports sorting, slicing, and deduplicating retrieved data before exporting or processing information. ([source](https://github.com/kennethreitz/records/blob/master/README.rst))
- [Bulk Executions](https://awesome-repositories.com/f/data-databases/sql-query-execution/bulk-executions.md) — Processes multiple SQL statements in a single operation or loads queries from files to increase data throughput. ([source](https://github.com/kennethreitz/records/blob/master/README.md))

### Security & Cryptography

- [Parameterized Query Bindings](https://awesome-repositories.com/f/security-cryptography/sql-injection-prevention/parameterized-query-bindings.md) — Implements parameterized query bindings to separate SQL logic from user-supplied values and prevent injection. ([source](https://github.com/kennethreitz/records/blob/master/README.md))

### Development Tools & Productivity

- [CLI Query Interfaces](https://awesome-repositories.com/f/development-tools-productivity/cli-query-interfaces.md) — Allows users to execute SQL commands and interact with the database through a dedicated command-line interface. ([source](https://github.com/kennethreitz/records/blob/master/HISTORY.rst))
- [Database CLI Tools](https://awesome-repositories.com/f/development-tools-productivity/database-cli-tools.md) — Provides a command-line interface for interacting with databases, executing queries, and retrieving data.
- [Database Export Pipelines](https://awesome-repositories.com/f/development-tools-productivity/database-export-pipelines.md) — Streams query results from the database engine directly to formatted file outputs via a command line interface.
- [SQL Command Line Interfaces](https://awesome-repositories.com/f/development-tools-productivity/sql-command-line-interfaces.md) — Includes a dedicated terminal tool for executing database statements and exporting results to files.
- [SQL Data Export Utilities](https://awesome-repositories.com/f/development-tools-productivity/sql-data-export-utilities.md) — Converts database query results into portable formats like CSV or JSON for reporting and sharing.
