Skip to main content
Documentation Status https://github.com/MacHu-GWU/sqlalchemy_upsert_kit-project/actions/workflows/main.yml/badge.svg https://codecov.io/gh/MacHu-GWU/sqlalchemy_upsert_kit-project/branch/main/graph/badge.svg https://img.shields.io/pypi/v/sqlalchemy-upsert-kit.svg https://img.shields.io/pypi/l/sqlalchemy-upsert-kit.svg https://img.shields.io/pypi/pyversions/sqlalchemy-upsert-kit.svg https://img.shields.io/badge/✍️_Release_History!--None.svg?style=social&logo=github https://img.shields.io/badge/⭐_Star_me_on_GitHub!--None.svg?style=social&logo=github
https://img.shields.io/badge/Link-API-blue.svg https://img.shields.io/badge/Link-Install-blue.svg https://img.shields.io/badge/Link-GitHub-blue.svg https://img.shields.io/badge/Link-Submit_Issue-blue.svg https://img.shields.io/badge/Link-Request_Feature-blue.svg https://img.shields.io/badge/Link-Download-blue.svg

Welcome to sqlalchemy_upsert_kit Documentation

https://sqlalchemy-upsert-kit.readthedocs.io/en/latest/_static/sqlalchemy_upsert_kit-logo.png

sqlalchemy_upsert_kit provides fast bulk upsert operations for SQLAlchemy applications, on SQLite and PostgreSQL. It offers three strategies:

  • insert_or_ignore: insert new records, and leave existing rows alone.

  • insert_or_replace: insert new records, and overwrite existing rows with the records.

  • insert_or_merge: insert new records, and update only chosen columns of existing rows.

Each call loads the records into a temporary staging table and writes them with one native INSERT ... ON CONFLICT statement, typically 5-20x faster than row-by-row upserts on large batches, which suits ETL, data synchronization, and other bulk loads. Every call is atomic, and can run in its own transaction or inside yours.

Install

sqlalchemy_upsert_kit is released on PyPI, so all you need is to:

$ pip install sqlalchemy-upsert-kit

To upgrade to latest version:

$ pip install --upgrade sqlalchemy-upsert-kit

Use with AI Coding Agents

This repo ships an Agent Skill that documents the public API of sqlalchemy_upsert_kit, so an AI coding agent such as Claude Code can use the library without reading its source. It lives in .claude/skills/pypi-sqlalchemy_upsert_kit. To use it in your project, copy it into your project’s .claude/skills/ folder. Run this from your project’s root:

$ git clone --depth 1 https://github.com/MacHu-GWU/sqlalchemy_upsert_kit-project.git /tmp/sqlalchemy_upsert_kit-project
$ mkdir -p .claude/skills
$ cp -R /tmp/sqlalchemy_upsert_kit-project/.claude/skills/pypi-sqlalchemy_upsert_kit .claude/skills/

Metadata

Release files for sqlalchemy_upsert_kit 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlalchemy_upsert_kit 0.2.1
File Size Uploaded Provenance Actions
sqlalchemy_upsert_kit-0.2.1.tar.gz 17.9 kB Without provenance Details for sqlalchemy_upsert_kit-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sqlalchemy_upsert_kit 0.2.1
File Interpreter ABI Platform Actions
sqlalchemy_upsert_kit-0.2.1-py3-none-any.whl Python 3 none any Details for sqlalchemy_upsert_kit-0.2.1-py3-none-any.whl

Total release size: 43.6 kB

Release files / sqlalchemy_upsert_kit-0.2.1.tar.gz

Download URL sqlalchemy_upsert_kit-0.2.1.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9128faed5194bfcbedec3641799def0d9094120b93bb88c967a8a13e1ac1b871
BLAKE2b-256 checksum
How to use checksums
aa1edf96d67e7e3cf0f12cd03ce64d9112ffdeef3a240f69e9394c8cc51c2193
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / sqlalchemy_upsert_kit-0.2.1-py3-none-any.whl

Download URL sqlalchemy_upsert_kit-0.2.1-py3-none-any.whl
Size 25.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1927ac63ddf7ca79602baa483320ecc6b6df08b14c60e9c092e204c4bdd8b095
BLAKE2b-256 checksum
How to use checksums
c59442ccb5bc5eef4ebac3f6ca79c307032981c0972086405ab91a845bf0c493
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for sqlalchemy_upsert_kit 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page