skillfed

atomicwrites-homeassistant

Atomic file writes.

atomicwrites-homeassistant v1.4.1 662.3K downloads/30d#5,439 on PyPI321
Permissive license MIT Abandoned released

What it is and what it does

Atomicwrites is a Python library for writing files in a way that guarantees atomicity—either the entire file is written successfully or the original file remains untouched. It works by writing to a temporary file in the same directory, then atomically moving it to the target location using platform-specific operations: `rename` on POSIX systems (or `link`/`unlink` when overwriting is not allowed) and `MoveFileEx` on Windows. The library also invokes `fsync` to ensure data is flushed to disk.

The package provides both a simple high-level context-manager API and a lower-level class-based interface. It supports an `overwrite` parameter to control whether the target file may already exist, and handles errors consistently across platforms. With no runtime dependencies, it integrates easily into any Python project that needs to safely write configuration files, databases, or other critical data without risk of corruption from crashes or concurrent access.

Use it for:

  • Writing configuration files that must not be corrupted if the process crashes mid-write
  • Atomically updating database or cache files in multi-process environments
  • Safely persisting application state or logs without risk of partial writes
  • Cross-platform file operations where atomicity guarantees are required

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides atomic file writes that ensure a file is either fully written or not written at all, preventing corruption from interrupted writes or concurrent access.

No—this package is abandoned (last release 2022-07-08, repository archived) and shows no active maintenance. While the code is stable and has no known vulnerabilities, using an unmaintained library for critical file operations carries long-term risk. Consider the original atomicwrites package if it has resumed maintenance, or evaluate whether your use case truly requires atomic writes or can tolerate simpler alternatives.

Install

atomicwrites-homeassistant on PyPI

pip

pip install atomicwrites-homeassistant

uv

uv add atomicwrites-homeassistant

poetry

poetry add atomicwrites-homeassistant

Installing atomicwrites-homeassistant

Before you install

Low install friction with no runtime dependencies. However, the package is abandoned—last release was 2022-07-08 and the repository is archived. This is a fork maintained because the original package is unmaintained, but the fork itself shows no active maintenance either.

License in practice

Licensed under MIT (permissive), so you can use it freely in commercial and open-source projects without restriction or obligation to share modifications.

Quickstart

from atomicwrites import atomic_write

with atomic_write('foo.txt', overwrite=True) as f:
    f.write('Hello world.')

Verify before relying

  • Whether this fork is actively maintained or has a clear succession plan despite the archived repository status
  • Real-world reliability of Windows atomic operations, which the documentation notes are not well-tested and may silently fall back to non-atomic methods

Package facts

License MIT (permissive)
Python support supports the current Python release (>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance abandoned — 1,498 days since the last release
Last repo commit (repository archived)
First released
Downloads 662,308/month — #5,439 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: atomicwrites_homeassistant-1.4.1-py2.py3-none-any.whl

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: Implementation :: CPython

Tags

atomic file writessafe file writingprevent file corruptiontransactional file operationsrace-free file creationtemporary file atomicitycross-platform file safety
file-iocross-platform

More Software Development packages