atomos
Atomic primitives for Python.
What it is and what it does
Atomos is a library of atomic primitives inspired by Java's concurrent.atomic package and Clojure's atoms. It wraps primitive types (int, float, bool) and arbitrary objects in thread-safe containers that handle locking semantics internally, allowing developers to safely share mutable state across threads without manually orchestrating locks.
The library's core concept is the Atom, which uses compare-and-set semantics to ensure that updates to shared state are atomic and consistent. Instead of calling swap() with a function that receives the current state and returns an updated one, developers can write cleaner concurrent code. Atomos also provides lower-level atomic primitives like AtomicInteger and AtomicReference for simpler use cases, and supports multiprocessing via a separate import path.
Use it for:
- Building thread-safe counters or accumulators in multi-threaded applications without explicit lock calls
- Managing shared application state (e.g., connected clients, session counts) in concurrent servers
- Protecting updates to complex objects in multi-threaded contexts using AtomicReference wrappers
- Porting concurrent patterns from Java or Clojure that rely on atomic types to Python
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Atomos provides thread-safe atomic primitives (integers, floats, bools, objects) and atoms for managing shared mutable state in multi-threaded Python applications without explicit lock management.
No. The package is abandoned (no releases or commits since 2015) and targets Python 2.7 and 3.3–3.4. While it has no known vulnerabilities and a permissive license, its compatibility with modern Python versions is unverified and unmaintained. For new projects requiring thread-safe primitives, consider actively maintained alternatives or Python's built-in threading and queue modules.
Install
atomos on PyPI
pip
pip install atomosuv
uv add atomospoetry
poetry add atomosInstalling atomos
Before you install
High install friction: the package is abandoned (last commit 2021-04-29, no releases since 2015-07-05) and has not been updated in many years. While it carries no known vulnerabilities and has no runtime dependencies, the stalled maintenance status means bug fixes and compatibility updates are unlikely.
License in practice
BSD license (permissive) places no restrictions on use, modification, or distribution in your own projects.
Quickstart
pip install atomos
import atomos.atom as atom
state = atom.Atom({'count': 0})
state.swap(lambda s: {**s, 'count': s['count'] + 1})
Package targets Python 2.7, 3.3, and 3.4; compatibility with later Python versions is unverified.
Verify before relying
- Whether atomos works correctly with Python versions released after 2015
- Whether the compare-and-set implementation remains performant or correct on modern CPython
- Whether multiprocessing support (mentioned in docs) is fully functional and tested
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 4,058 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 118,687/month — #12,107 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: atomos-0.3.1.tar.gz
Keywords: atom, atomic, concurrency, lock
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
atomic_dictAtomic-Dict provides a lock-free, shared 64-bit…
permissive · top 15,000 on PyPI
oslo.concurrencyoslo.concurrency provides locking mechanisms…
permissive · top 15,000 on PyPI
fifolockFifolock provides a low-level building block…
permissive · top 15,000 on PyPI
fastenersProvides cross-platform locks for synchronizing…
permissive · top 5,000 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
aiologicaiologic provides thread-aware and async-aware…
permissive · top 5,000 on PyPI
python-dynamodb-lockProvides distributed locking on top of DynamoDB…
permissive · top 15,000 on PyPI
lockfileProvides a platform-independent file locking…
permissive · top 1,000 on PyPI
flufl.lockProvides NFS-safe file locking with timeout…
permissive · top 5,000 on PyPI
PyMySQLLockProvides distributed locking primitives backed…
permissive · top 15,000 on PyPI