No project description provided
Project description
openz
A strange file opener.
Usage
from openz import open_for_write, try_rollback
with open_for_write(
path,
text_mode=True,
overwrite=True,
with_atomicwrite=True,
with_lockfile=True,
with_exclusive=False, # unable work with `with_atomicwrite`
with_backup=True
) as fp:
fp.write('content')
Restore data from crash
Make sure set with_backup=True
and backup_for_fault=True
:
with open_for_write(path, with_backup=True, backup_for_fault=True) as fp:
...
Then you can restore it from the backup:
try_rollback(path)
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
openz-0.1.1.tar.gz
(3.2 kB
view details)
Built Distribution
openz-0.1.1-py3-none-any.whl
(3.7 kB
view details)
File details
Details for the file openz-0.1.1.tar.gz
.
File metadata
- Download URL: openz-0.1.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.7 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3cfd34c909d3a7238ba3829a552f7a06a924be085a4a6b532d53f1f0b7661bc |
|
MD5 | 8f30dcb43aa4c10b7a4705d6a894343c |
|
BLAKE2b-256 | d5bdbd35a9b25ff6a1d46f72be376a7cbe9b71e48a2c56cb651a4cf73f320b62 |
File details
Details for the file openz-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: openz-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.7 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cc3d89ad55a007d5858b4c2ba91832e2f48d70b64319b7c183faf1bbf7db70f |
|
MD5 | d7600aedd441abb1bcf74b6b1364cc0f |
|
BLAKE2b-256 | 0f13834c998043e0a90f93d2ac3767a76c11b8ae084b6d47c27d4f46ce2a9f1a |