Skip to main content

datagit-sdk

Python SDK for DataGit — Git-style version control for rows in your own PostgreSQL or MySQL database.

pip install datagit-sdk

Installed as datagit-sdk, imported as datagit — the distribution name and the import package are separate in Python, and the import keeps the shorter name.

from decimal import Decimal
from datagit import Client, col

with Client("datagit.internal:443", api_key=KEY) as c:
    items = c.repo("catalog").table("products")

    # Reading a BRANCH. Reads on main need no DataGit at all — query the table.
    for row in items.read(branch="q4-pricing", where=col(3) == "outdoor"):
        print(row)

    # One commit, however many rows.
    with items.transaction(branch="q4-pricing", message="Q4 pricing") as tx:
        tx.update(pk, {1: "TENT-4P", 4: Decimal("268.92")})

Three things this SDK will not let you do

Set a commit author. It comes from the credential. An audit trail whose author is client-supplied is decoration, so there is no field to pass.

Send a decimal as a float. Values are hashed into history, so a rounding difference would change a commit id for data nobody edited. Exact numbers travel as decimal.Decimal and go on the wire as strings.

Build a filter from a string. Filters are typed expression trees with no SQL text form, so there is nothing to inject into. A hostile string passed as a filter value stays a value.

Rows are keyed by column id

Not by name. A rename is metadata-only in DataGit, and keying by name would let a rename silently change what a row means on the wire.

Batch your writes

A commit takes the branch's ref lock, so throughput is commits per second regardless of how many rows each carries. One commit of a thousand rows costs roughly what one commit of one row costs, and a loop of single-row commits is the slowest possible way to write.

Versioning

This package and the npm @glyphsoftware/datagit-sdk package are the same contract twice and release on one version number. A change to the canonical encoding is always a major, even when this SDK's own API is untouched.

Apache 2.0.

Metadata

Release files for datagit-sdk 0.1.0

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

Source distribution (sdist)

Source distribution for datagit-sdk 0.1.0
File Size Uploaded
datagit_sdk-0.1.0.tar.gz 21.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for datagit-sdk 0.1.0
File Interpreter ABI Platform
datagit_sdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 42.6 kB

Release files / datagit_sdk-0.1.0.tar.gz

Download URL datagit_sdk-0.1.0.tar.gz
Size 21.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c13209c44f36153c984d3ba0d4a8ed5d0724a0e8ab6119a82beed2ef3fe07509
BLAKE2b-256 checksum
How to use checksums
6d4998f9d98cceb231d6486a1480836e790c58155f967c1341a247deec160026
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 2, 2026.

Transparency log

Release files / datagit_sdk-0.1.0-py3-none-any.whl

Download URL datagit_sdk-0.1.0-py3-none-any.whl
Size 20.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d3b225e834615a1ffc8776ae1f47100a11912bd9b4d417b250efd0b135c77fc8
BLAKE2b-256 checksum
How to use checksums
da619318aaf8f37c3ec9926c80e96e8173e3e7ffd75a0c8615d186ab921b128e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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