Skip to main content

Atomic filesystem operations for safe batch processing.

Project description

fs-transaction

Stop writing half-broken file scripts. fs-transaction brings database-style atomicity to filesystem operations.

The Problem

You write a script to process 1,000 files. It crashes on file #500. Now you have a corrupted state: 500 files moved, 500 remaining. You have to manually cleanup the mess.

The Solution

Wrap your operations in a Transaction. If any error occurs, nothing happens on disk.

from fs_transaction import Transaction

# No changes applied until the block finishes successfully
with Transaction() as t:
    t.move("data.csv", "archive/data_2023.csv")
    t.write("manifest.txt", "Archived successfully")
    
    # If this raises an error, the move is undone and manifest is never written.
    t.copy("backup.img", "cloud/backup.img")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fs_transaction-0.1.1.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fs_transaction-0.1.1-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file fs_transaction-0.1.1.tar.gz.

File metadata

  • Download URL: fs_transaction-0.1.1.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fs_transaction-0.1.1.tar.gz
Algorithm Hash digest
SHA256 88475248b79473ca775ff934ad807fb40e46ce8b0b81d9cb1e25431663c41e31
MD5 bc05f6af67b7b323b3ce5abab8692333
BLAKE2b-256 ff3d49c90978eafbcff918bf6aefe600f4921cfa6fea0befe94facd6c262ac68

See more details on using hashes here.

Provenance

The following attestation bundles were made for fs_transaction-0.1.1.tar.gz:

Publisher: python-publish.yml on SKAUL05/fs-transaction

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fs_transaction-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: fs_transaction-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fs_transaction-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 99297144a2493ea32f8fa41b3c7b201e7a838a0bb8d289cbc8d49acf29b95949
MD5 88c2cd0f19584d744da49e71e9ef96ea
BLAKE2b-256 1ea1238df93b63616c5ecf092bc26f6c2709ed5f009fae0304fb0b98eeb9bd92

See more details on using hashes here.

Provenance

The following attestation bundles were made for fs_transaction-0.1.1-py3-none-any.whl:

Publisher: python-publish.yml on SKAUL05/fs-transaction

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page