A collection of Python utility functions for ingesting data into SQLAlchemy-defined PostgreSQL tables, automatically migrating them as needed, and minimising locking
Project description
pg-bulk-ingest
A Python utility function for ingesting data into SQLAlchemy-defined PostgreSQL tables, automatically migrating them as needed, allowing concurrent reads as much as possible.
Allowing concurrent writes is not an aim of pg-bulk-ingest. It is designed for use in ETL pipelines where PostgreSQL is used as a data warehouse, and the only writes to the table are from pg-bulk-ingest. It is assumed that there is only one pg-bulk-ingest running against a given table at any one time.
Features
pg-bulk-ingest exposes a single function as its API that:
- Creates the tables if necessary
- Migrates any existing tables if necessary, minimising locking
- Ingests data in batches, where each batch is ingested in its own transaction
- Handles "high-watermarking" to carry on from where a previous ingest finished or errored
- Optionally performs an "upsert", matching rows on primary key
- Optionally deletes all existing rows before ingestion
- Optionally calls a callback just before each batch is visible to other database clients
Visit the pg-bulk-ingest documentation for usage instructions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pg_bulk_ingest-0.1.0.tar.gz.
File metadata
- Download URL: pg_bulk_ingest-0.1.0.tar.gz
- Upload date:
- Size: 22.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb437708169b587e15e447143a1ea67ccca7bd44ec5b52b7baf5fd6654134399
|
|
| MD5 |
5b01e85cb11b8b8edb574b14992d38d4
|
|
| BLAKE2b-256 |
5dc91e767966e83a97f9a628ab2247feb0ffd650e646947605b1bed8360c0447
|
Provenance
The following attestation bundles were made for pg_bulk_ingest-0.1.0.tar.gz:
Publisher:
deploy-package-to-pypi.yml on uktrade/pg-bulk-ingest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pg_bulk_ingest-0.1.0.tar.gz -
Subject digest:
eb437708169b587e15e447143a1ea67ccca7bd44ec5b52b7baf5fd6654134399 - Sigstore transparency entry: 1369990130
- Sigstore integration time:
-
Permalink:
uktrade/pg-bulk-ingest@f5eabb0278c9418136af3bcb9a78309d09c7ea47 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/uktrade
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy-package-to-pypi.yml@f5eabb0278c9418136af3bcb9a78309d09c7ea47 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pg_bulk_ingest-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pg_bulk_ingest-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d2db2084c6c72ba09a74b6bcba889e99aeb21502f3da110cb960918185e3eef
|
|
| MD5 |
b57e5456594ace664c3ff401c2996201
|
|
| BLAKE2b-256 |
e4f4503e0f173560ca8af23d9f14c9f1a08a2c9b6f63a70a3dfae31ff9134bb5
|
Provenance
The following attestation bundles were made for pg_bulk_ingest-0.1.0-py3-none-any.whl:
Publisher:
deploy-package-to-pypi.yml on uktrade/pg-bulk-ingest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pg_bulk_ingest-0.1.0-py3-none-any.whl -
Subject digest:
6d2db2084c6c72ba09a74b6bcba889e99aeb21502f3da110cb960918185e3eef - Sigstore transparency entry: 1369990440
- Sigstore integration time:
-
Permalink:
uktrade/pg-bulk-ingest@f5eabb0278c9418136af3bcb9a78309d09c7ea47 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/uktrade
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy-package-to-pypi.yml@f5eabb0278c9418136af3bcb9a78309d09c7ea47 -
Trigger Event:
release
-
Statement type: