Atomic Writing for Python

Build Status

A simple implementation of decorator to guarantee that the data is not partially written to the file by writing to a temporary file that gets renamed and deleted after writing.

Usage:

from atomicwrite import atomic_write

@atomic_write
my_writer(content: str, file: str, mode = Optional[str] = 'wb') -> None:
    pass

Run a demo of decorator on a parquet file

python parquet_demo.py

Run unit test

python test_atomicwrite.py