Skip to main content

No project description provided

Project description

openz

Python Testing

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


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.2.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

openz-0.1.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file openz-0.1.2.tar.gz.

File metadata

  • Download URL: openz-0.1.2.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

Hashes for openz-0.1.2.tar.gz
Algorithm Hash digest
SHA256 fb9510690fa02cdccdc1785bb75bcb0b1b1c63795c2d1dd03f3a29531b986268
MD5 b9453fa75802eb2f0520410bd1f9a8d2
BLAKE2b-256 74b1bdd3d3cdaf61930694a77b3ad3d0dc8aaab04777250a90e9c1aa9f411af9

See more details on using hashes here.

File details

Details for the file openz-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: openz-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.7 Windows/10

File hashes

Hashes for openz-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 047153f240ea913fee81db1511302dae8f569a83e967b11c17918122bac159ab
MD5 f6d155468c2270d709aa06c65ac31af1
BLAKE2b-256 885d88c7cba8b33bd4985811921272aa3b07a6dcf3aaad66ccbaeb193c079205

See more details on using hashes here.

Supported by

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