atomicwrites-homeassistant
Atomic file writes.
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-homeassistantuv
uv add atomicwrites-homeassistantpoetry
poetry add atomicwrites-homeassistantInstalling 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
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
atomicwritesProvides a context manager for writing files…
permissive · top 5,000 on PyPI
types-atomicwritesProvides type stubs for the atomicwrites…
permissive · top 15,000 on PyPI
lockfileProvides a platform-independent file locking…
permissive · top 1,000 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
pathlib-mateExtends Python's pathlib.Path with convenience…
permissive · top 5,000 on PyPI
DrissionRecordBuffers and writes data to files (xlsx, csv,…
permissive · top 15,000 on PyPI
django-read-onlyPrevents Django database write operations by…
permissive · top 15,000 on PyPI
ephemeral-port-reserveReserves an ephemeral port reliably and…
permissive · top 15,000 on PyPI
boltonsBoltons provides a collection of over 230…
permissive · top 1,000 on PyPI
azure-storage-fileProvides a Python client library to create,…
permissive · top 5,000 on PyPI