Skip to main content

AtomicFile

https://travis-ci.org/sashka/atomicfile.svg?branch=master

Writeable file object that atomically updates a file.

All writes will go to a temporary file. Call close() explicitly when you are done writing, and AtomicFile will rename the temporary copy to the original name, making the changes visible. If the object is destroyed without being closed, all your writes are discarded.

AtomicFile is friendly to with statement.

from atomicfile import AtomicFile

with AtomicFile("panic.txt", "w") as f:
    f.write(json.dumps(big_data_array_100MB, sort_keys=True, indent=4))

Install

To install AtomicFile, simply:

pip install atomicfile

Metadata

Release files for atomicfile 1.0.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 atomicfile 1.0.1
File Size Uploaded
atomicfile-1.0.1.tar.gz 2.3 kB Details

Built distribution (wheel)

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

Total release size: 5.9 kB

Release files / atomicfile-1.0.1.tar.gz

Download URL atomicfile-1.0.1.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
190502c5c0b1145f5c294e0be07a9f029d8ea728a0d0806e0ca466467208763e
BLAKE2b-256 checksum
How to use checksums
550f01130bdbdcfe15345eba5cf256d9dd73ec5f19e1178e2d630a77aa68654f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.3.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.4

Release files / atomicfile-1.0.1-py3-none-any.whl

Download URL atomicfile-1.0.1-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fcd84786e43a60e74fa60ad456bca0a58a3c1bff9d6cbba887fd0e760ad4710b
BLAKE2b-256 checksum
How to use checksums
0ccd40710daa37980e0fa5f7246cb01452ddfdd7fe69a5ef4b658de0587d9883
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.3.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.4

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0

1 release file

0.1

1 release file

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