sqlalchemy-mate
A library extend sqlalchemy module, makes CRUD easier.
Decision gist · record as of 2026-08-14
Yes, if you regularly work with SQLAlchemy and need to handle bulk operations or credential management. The library is actively maintained, has no known vulnerabilities, and low install friction. It's most valuable for applications doing frequent bulk inserts with potential conflicts or managing credentials across multiple environments. For simple CRUD operations or single-row inserts, the overhead may not justify the dependency.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires sqlalchemy and prettytable as runtime dependencies; Python 3.8 or later.
- Low install friction with only two runtime dependencies (sqlalchemy and prettytable).
- Actively maintained with recent commits; last release was 799 days ago but repository shows ongoing activity.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use this package in commercial and proprietary projects without restriction.
last release 2024-06-06 (799 days) · last repo commit 2026-03-30 · 2 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 941,565 downloads/mo, #4,678 on PyPI
Alternatives
Verify before relying
pip install sqlalchemy_mate
from sqlalchemy_mate.api import EngineCreator
ec = EngineCreator.from_env(prefix="DB_DEV")
engine = ec.create_postgresql_psycopg2()
from sqlalchemy_mate.api import ExtendedBase
User.smart_insert(engine, data)- Whether smart_insert actually reduces commit count compared to standard bulk operations in practice.
- Performance characteristics of smart_insert strategy with very large datasets.
- Compatibility with SQLAlchemy 2.0+ async features and modern connection pooling.
What it is and what it does
sqlalchemy_mate is a wrapper library around SQLAlchemy that provides convenience functions for common database operations. It focuses on two main areas: securely loading database credentials from multiple sources (JSON files, environment variables, AWS S3, AWS KMS) without embedding secrets in code, and performing bulk insert/update/upsert operations more efficiently than row-by-row approaches.
The library extends SQLAlchemy's ORM with an ExtendedBase class that adds methods like smart_insert, update_all, and upsert_all directly to your model classes. It also provides an EngineCreator utility that abstracts away connection string construction, supporting PostgreSQL, Redshift, and other databases. The smart_insert strategy attempts bulk operations but falls back to smaller batches when primary key conflicts occur, reducing total commits compared to one-by-one inserts.
Use it for
- Load database credentials from JSON files or environment variables without hardcoding secrets in application code.
- Perform bulk inserts of thousands of records while gracefully handling primary key conflicts without one-by-one retry logic.
- Automatically update or upsert multiple records by primary key in a single operation using ORM models.
- Simplify SQLAlchemy connection setup across different database engines (PostgreSQL, Redshift) with a unified API.
- Integrate AWS KMS decryption into credential loading for cloud-deployed applications.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you regularly work with SQLAlchemy and need to handle bulk operations or credential management.
The library is actively maintained, has no known vulnerabilities, and low install friction. It's most valuable for applications doing frequent bulk inserts with potential conflicts or managing credentials across multiple environments. For simple CRUD operations or single-row inserts, the overhead may not justify the dependency.
Install
sqlalchemy-mate on PyPI
Before you install
Low install friction with only two runtime dependencies (sqlalchemy and prettytable). Actively maintained with recent commits; last release was 799 days ago but repository shows ongoing activity.
Requires sqlalchemy and prettytable as runtime dependencies; Python 3.8 or later.
License in practice
MIT license is permissive; you can use this package in commercial and proprietary projects without restriction.
Quickstart
pip install sqlalchemy_mate
from sqlalchemy_mate.api import EngineCreator
ec = EngineCreator.from_env(prefix="DB_DEV")
engine = ec.create_postgresql_psycopg2()
from sqlalchemy_mate.api import ExtendedBase
User.smart_insert(engine, data)
Verify before relying
- Whether smart_insert actually reduces commit count compared to standard bulk operations in practice.
- Performance characteristics of smart_insert strategy with very large datasets.
- Compatibility with SQLAlchemy 2.0+ async features and modern connection pooling.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagessqlalchemyprettytable |
| Maintenance | Actively maintained 799 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 941,565 / month, #4,678 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: sqlalchemy_mate-2.0.0.3-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 › “sqlalchemy bulk insert”
- sqlalchemy-mateSimplifies SQLAlchemy code with helper functions for credential…
- advanced-alchemyAdvanced Alchemy provides sync and async SQLAlchemy repositories with…
- bcpandasWraps SQL Server's BCP utility to transfer data between pandas…
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-mixins · sqlbag · zope.sqlalchemy · sqlalchemy-solr · ipython-sql · SQLAlchemy · pangres · advanced-alchemy · Flask-SQLAlchemy · sqlalchemy-repr