Skip to main content

Safeout: write out a file safely

With safeout, you can write:

from safeout import safeout
with safeout('output.txt') as output:
    output.write("Hello world\n")

and this will write out the file output.txt in a safe, atomic manner. That is, if there are any problems (Exceptions or a crash) in the with block, then there there will be no output. If the with block completes, then the output file will include the whole result.

So, if the output file exists, you can be confident that the process completed correctly.

License: MIT

Metadata

Release files for Safeout 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Safeout 0.3
File Size Uploaded
Safeout-0.3.tar.gz 2.0 kB Details

Release files / Safeout-0.3.tar.gz

Download URL Safeout-0.3.tar.gz
Size 2.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3703b522f865f81338d07c95d3ceaf7bda2fa46dfbe6da5590a467bd7b1f1fcc
BLAKE2b-256 checksum
How to use checksums
e58a6d53feedef23966c20c79ffcd2fde8036188c21e5bdd630f26683124223f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.20.1 setuptools/40.4.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.6.8

Release history Release notifications | RSS feed

This release

0.3 This release

1 release file

0.2.1

1 release file

0.2

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