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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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