Registry / type-stubs / types-atomicwrites

types-atomicwrites

JSON →
library1.4.5.1pypypiunverified

types-atomicwrites is a PEP 561 type stub package for the atomicwrites library, currently at version 1.4.5.1. It provides type annotations for use by static type checkers like MyPy and PyCharm. While it is part of the broader typeshed project, this specific stub package is explicitly noted as unmaintained and will not be updated. Furthermore, the underlying atomicwrites library itself has been marked as deprecated by its original maintainer, who recommends using Python 3's built-in os.replace or os.rename functions for most atomic file writing needs.

pip install types-atomicwrites
INSTALL
IMPORT
SIG · TYPES-ATOMICWRITES
T
types-atomicwrites
type-stubspythonv1.4.5.1
Install
2.0s avg
Import
12ms
Disk
66MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.4.5.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.940 runs
installs and imports cleanly · install 0.0s · import 0.014s · 67.1MB
glibc
py 3.103.940 runs
installs and imports cleanly · install 2.0s · import 0.010s · 18MB
66MB installed
● package 66MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

atomic_write
from atomicwrites_stubs import atomic_write
from atomicwrites-stubs import atomic_write

This quickstart demonstrates how to perform an atomic file write using the `atomicwrites` library. Installing `types-atomicwrites` alongside `atomicwrites` will enable static type checking for this code.

from atomicwrites import atomic_write def save_data_atomically(filename: str, content: str): try: with atomic_write(filename, overwrite=True) as f: f.write(content) print(f"Successfully wrote to {filename}") except Exception as e: print(f"Error writing to {filename}: {e}") # Example usage: save_data_atomically("my_config.txt", "config_key=value\nother_setting=123")
Debug
Known issues
breakingThe `types-atomicwrites` package is officially unmaintained and will not receive further updates. This means future versions of `atomicwrites` may not have corresponding, accurate type stubs, potentially leading to incorrect type checking results or runtime errors if type-checked code relies on outdated signatures.
fix
Consider migrating to `os.replace` or `os.rename` for atomic operations, or another actively maintained atomic writing library. Alternatively, pin `atomicwrites` to a version compatible with the latest stubs (e.g., `atomicwrites==1.4.0`) to avoid type-checking discrepancies.
affects: All versions after 1.4.5.1
deprecatedThe upstream `atomicwrites` library itself is considered deprecated by its original maintainer, who advises using `os.replace` or `os.rename` for atomic file operations in Python 3. This deprecation stems from issues including PyPI's 2FA requirements and the maintainer's decision not to continue maintenance.
fix
For new projects, prefer Python's built-in `os.replace` or `os.rename` functions for atomic file writes. For existing projects, evaluate migration away from `atomicwrites` to these standard library functions or an actively maintained alternative.
affects: All versions of `atomicwrites`
gotcha`atomicwrites` (and thus code relying on its stubs) may not be truly atomic in all scenarios, especially on Windows or when files are moved across different filesystems. This can lead to data corruption or unexpected states in case of system failure.
fix
Ensure that the temporary file and the target file reside on the same filesystem. For critical applications, thoroughly test atomicity guarantees on target deployment platforms and consider additional layers of data validation or recovery.
affects: All versions of `atomicwrites`
Upgrade
Version history
1.4.5.1latest on PyPI · released Oct 17, 2022
Audit
Dependencies
atomicwritesrequiredProvides the runtime functionality for which these stubs are provided.
Agent activity
35 hits · last 30 days
node
32
OpenAI (training)
1
Resources
types-atomicwrites — pip install types-atomicwrites · libregistry