Skip to main content

txstore

Unified object storage for Python: one Storage interface over a local filesystem, S3-compatible buckets, and HTTP servers, selected by URL. Read, write, list, and stream objects between backends with the same calls, and on the filesystem and S3, optionally group writes into a transaction you commit, discard, or revert as one unit.

Current version: 0.1.1. Planned work → ROADMAP.md.

Capabilities

  • One Storage interface over the filesystem (fs://), S3-compatible object stores (s3://), read-only HTTP (http://, https://), and a write-only digest sink; make_storage(url) picks the backend, so code switches storage by changing a URL.
  • Get, put, list, copy, move, and metadata calls that behave the same on every backend that supports them.
  • Transactions on filesystem and S3: writes are staged as hidden footmark objects and committed, discarded, or reverted together.
  • A transaction history at the storage root with age and count retention, revert of the latest transaction, and cleanup of orphaned footmarks.
  • A cross-process writer lock: flock on the filesystem, conditional writes on S3.
  • Streamed transfers between storages that return MD5, SHA-1, SHA-256, and SHA-512 digests in one pass.
  • S3 canned-ACL preservation across transactional copies and metadata rewrites.
  • Configuration by keyword arguments or TXSTORE_* environment variables; no CLI coupling.

Quick start

Install

Released versions are published to PyPI:

pip install txstore

Settings → CONFIG.md; behavior → STORAGE.md.

Stream between backends

Every backend is a Storage built from a URL, so moving data between technologies is one call. Download a web page and save it to disk, streamed in chunks rather than loaded into memory:

from txstore import make_storage

web = make_storage("https://docs.python.org/3")
disk = make_storage("fs:///srv/data", create_path=True)

digests = web.transfer("library/io.html", disk, "pages/io.html")
print(digests)
# {'MD5Sum': '...', 'SHA1': '...', 'SHA256': '...', 'SHA512': '...', 'Size': '180750'}

Swap either URL for s3://... and the same call uploads to or downloads from a bucket. HTTP storage is read-only and does not follow redirects; point the base URL at the final location.

Group writes into a transaction

Writes to the filesystem or S3 can be grouped into a transaction:

from txstore import HistoryRetention, TransactionHistory, make_storage, maybe_transaction

storage = make_storage("fs:///srv/data", create_path=True)
retention = HistoryRetention.from_env()

# Write a data file and the manifest that points to it: both are applied together on commit.
with maybe_transaction(storage, retention):
    storage.put("reports/october.csv", b"day,orders\n1,42\n2,57\n")
    storage.put("manifest.json", b'{"latest": "reports/october.csv"}')

# A failure inside the block discards every staged write.
try:
    with maybe_transaction(storage, retention):
        storage.put("reports/november.csv", b"day,orders\n1,???\n")
        raise ValueError("validation failed")
except ValueError:
    assert not storage.exists("reports/november.csv")

# Changed your mind later? Revert the last transaction as one unit.
history = TransactionHistory(storage)
print(
    [(t.id, t.timestamp.to_json()) for t in history.load()]
)  # [(1, '2026-10-23T19:08:36.024119Z')]
history.revert_last()
assert not storage.exists("manifest.json")

Connect to S3

On S3, pass the endpoint and bucket in the URL and the credentials as arguments or variables:

export TXSTORE_S3_ACCESS=... TXSTORE_S3_SECRET=...
storage = make_storage("s3://s3.example.com/bucket/prefix", s3_default_acl="private")

Documentation

Location Audience Authority
/ root contract documents Contributors and AI agents Canonical
docs/guides/ Library users Non-canonical guides and examples
docs/development/ Contributors Non-canonical code maps, flow diagrams, explanations
docs/reference/ Contributors and tooling Non-canonical reference artifacts

Canonical ownership

Domain owners and agent navigation → AGENTS.md.

Technology

Python 3.13+, boto3, requests, pyxattr; pytest, moto, Ruff, mypy, and uv for development.

License

MIT → LICENSE.

Metadata

Release files for txstore 0.1.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 txstore 0.1.1
File Size Uploaded Provenance Actions
txstore-0.1.1.tar.gz 370.0 kB With provenance Details for txstore-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 459.9 kB

Release files / txstore-0.1.1.tar.gz

Download URL txstore-0.1.1.tar.gz
Size 370.0 kB
Tags Source
SHA-256 checksum
How to use checksums
34996b3cef710ec9b460d2a22a1357b5c1d5054aa7baa67e9076d7f3e430c024
BLAKE2b-256 checksum
How to use checksums
836ae190107f91332d0d0768076ded53114bd6e6c1321911b44110b3079f8a1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 7, 2026.

Transparency log

Release files / txstore-0.1.1-py3-none-any.whl

Download URL txstore-0.1.1-py3-none-any.whl
Size 89.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c64701f4d34feaa07ca3025cea2e9d51646b2b94d65b4b605948fec04b0f0583
BLAKE2b-256 checksum
How to use checksums
7cdc37e87ffd3dd918921387f46e8f43ce8539d173adf3f5727ef37bc0114129
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 7, 2026.

Transparency log

Security for txstore 0.1.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for txstore-0.1.1.tar.gz

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 Nov 7, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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