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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88475248b79473ca775ff934ad807fb40e46ce8b0b81d9cb1e25431663c41e31
|
|
| MD5 |
bc05f6af67b7b323b3ce5abab8692333
|
|
| BLAKE2b-256 |
ff3d49c90978eafbcff918bf6aefe600f4921cfa6fea0befe94facd6c262ac68
|
Provenance
The following attestation bundles were made for fs_transaction-0.1.1.tar.gz:
Publisher:
python-publish.yml on SKAUL05/fs-transaction
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fs_transaction-0.1.1.tar.gz -
Subject digest:
88475248b79473ca775ff934ad807fb40e46ce8b0b81d9cb1e25431663c41e31 - Sigstore transparency entry: 835974388
- Sigstore integration time:
-
Permalink:
SKAUL05/fs-transaction@0132fcb6b7205d49343fbd94c181c0ce191e7115 -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/SKAUL05
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0132fcb6b7205d49343fbd94c181c0ce191e7115 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99297144a2493ea32f8fa41b3c7b201e7a838a0bb8d289cbc8d49acf29b95949
|
|
| MD5 |
88c2cd0f19584d744da49e71e9ef96ea
|
|
| BLAKE2b-256 |
1ea1238df93b63616c5ecf092bc26f6c2709ed5f009fae0304fb0b98eeb9bd92
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fs_transaction-0.1.1-py3-none-any.whl -
Subject digest:
99297144a2493ea32f8fa41b3c7b201e7a838a0bb8d289cbc8d49acf29b95949 - Sigstore transparency entry: 835974425
- Sigstore integration time:
-
Permalink:
SKAUL05/fs-transaction@0132fcb6b7205d49343fbd94c181c0ce191e7115 -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/SKAUL05
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0132fcb6b7205d49343fbd94c181c0ce191e7115 -
Trigger Event:
release
-
Statement type: