Skip to content

Repository files navigation

logo AtomicIO

https://travis-ci.org/datalib/atomicio.svg?branch=master

A library for making atomic file writes. Basically it guarantees that the data is not partially written to the file (hence corrupting it in case an exception is raised) by writing to a temporary file that gets renamed and deleted after writing.

fromatomicio.apiimportatomic_writewithatomic_write(path) as (r,w):
foriteminr:
w.write(process(item))

There are many other libraries that provide this functionality in Python. This library's approach and API is inspired by fatomic and python-atomicwrites respectively. So far atomicio has not been tested on Windows but it shouldn't work because currently, os.rename does not work on already created files.

About

Atomic writes to files

Resources

Stars

6 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages