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.3. 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; get_digests returns them without a copy.
  • Bounded reads: max_size on get, transfer, and get_digests stops an untrusted source at the limit with StorageTooLargeException, a compressed HTTP body included → STORAGE.md.
  • 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. Prerequisites → SETUP.md.

pip install txstore

Example 1: Put and get

Every backend is a Storage built from a URL. Put and get operations work the same way on all supported backends (filesystem, S3 and other):

from txstore import make_storage

storage = make_storage("fs:///srv/data", create_path=True)

storage.put("hello.txt", b"hello world")
print(storage.get("hello.txt"))
# b'hello world'

Example 2: Stream between backends

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'}

Example 3: Group writes into a transaction

Writes can be transactional to ensure atomicity. Committed operations are applied together, while failures discard all staged writes:

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")

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.3

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.3
File Size Uploaded Provenance Actions
txstore-0.1.3.tar.gz 383.9 kB With provenance Details for txstore-0.1.3.tar.gz

Built distribution (wheel)

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

Total release size: 477.8 kB

Release files / txstore-0.1.3.tar.gz

Download URL txstore-0.1.3.tar.gz
Size 383.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d9a7d721126fb1d330a957918113fb976b1b8d575e05d2776932bf3b86d33a95
BLAKE2b-256 checksum
How to use checksums
35035c9da7c4e61ae2b545615311c23f2bf9a2339dfdec354e5450bc6694a6ba
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 21, 2026.

Transparency log

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

Download URL txstore-0.1.3-py3-none-any.whl
Size 93.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
306acb4197b7d55515a2293770b8ae65ad7c68a9cf31dcec6b908d9ca7835e75
BLAKE2b-256 checksum
How to use checksums
f8b22cf7de710e4cedac6718dc1eda532d384e1153dabee6133b052235af3eda
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 21, 2026.

Transparency log

Security for txstore 0.1.3

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.3.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 21, 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.

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