Skip to content

Maintained compatibility shim for python-atomicwrites, delegating all functionality to safeatomic.

License

Notifications You must be signed in to change notification settings

atomic-libs/python-atomicwrites

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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 preserves the historic atomicwrites API while delegating 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.

Requirements

Core dependencies

Development dependencies ([dev] extra)


Installation

Using pip

For development (includes dev dependencies):

pip install -e .[dev] git+https://github.com/atomic-libs/safeatomic.git

For runtime only:

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

Using uv

For development:

uv pip install -e .[dev]

Note: safeatomic is pulled directly from GitHub via [tool.uv.sources] in pyproject.toml.

For runtime only:

uv pip install python-atomicwrites

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


If you want, I can also prepare a matching **`requirements.txt`** so that both `pip install -r requirements.txt` and `uv pip install -r requirements.txt` work out-of-the-box.  
Do you want me to generate that file too?

About

Maintained compatibility shim for python-atomicwrites, delegating all functionality to safeatomic.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages

  • Python 100.0%