Skip to content
This repository was archived by the owner on Jul 16, 2022. It is now read-only.

untitaker/python-atomicwrites

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

141 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-atomicwrites

Compatibility layer for legacy atomicwrites users, powered by safeatomic.

The original atomicwrites project by Markus Unterwaditzer is no longer maintained after PyPI's 2FA enforcement.
This repository is a from-scratch rewrite that keeps the historic atomicwrites API but delegates all file operations to the actively maintained safeatomic package.

Purpose

  • Preserve drop-in compatibility with existing atomicwrites-based code.
  • Allow seamless migration to safeatomic without changing existing imports.
  • Maintain API stability for projects that cannot refactor immediately.

Installation

pip install https://github.com/atomic-libs/safeatomic
pip install https://github.com/atomic-libs/python-atomicwrites

Note: The python-atomicwrites package is just a thin wrapper and requires safeatomic to be installed.

Usage

The API matches the original atomicwrites module:

from atomicwrites import atomic_write, replace_atomic, move_atomic, AtomicWriter

# Write atomically to a file
with atomic_write("example.txt", overwrite=True) as f:
    f.write("Hello, world!")

# Replace a file atomically
replace_atomic("temp.txt", "target.txt")

# Move a file atomically
move_atomic("source.txt", "destination.txt")

Upstream Reference

About

Powerful Python library for atomic file writes.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors