AtomicFile
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)
| File | Size | Uploaded | |
|---|---|---|---|
| atomicfile-1.0.1.tar.gz | 2.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|