solus
Singleton types.
What it is and what it does
solus provides two singleton type classes—Singleton and UnsafeSingleton—that enforce the singleton pattern at the class level. Singleton creates thread-safe instances that can be safely instantiated from multiple threads, while UnsafeSingleton creates faster but non-thread-safe singletons intended for single-threaded contexts. You inherit from either class to make your class a singleton; subsequent instantiation attempts return the same instance.
The package depends only on named, a utility library for type annotations. It's a minimal, focused tool for developers who need singleton behavior without rolling their own implementation or pulling in a large framework. The library is typed and supports Python 3.8 through 3.12.
Use it for:
- Enforce a single global logger or configuration manager instance across an application.
- Create thread-safe service objects that should only be instantiated once in a multi-threaded environment.
- Build a single-instance cache or connection pool that all parts of the code share.
- Implement a registry or factory that must exist as exactly one instance throughout the application lifecycle.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides thread-safe and thread-unsafe singleton type decorators for Python, allowing you to create classes that instantiate only once.
Yes, if you need singleton behavior and want a lightweight, typed implementation. The package is stable, has no vulnerabilities, and low install friction. However, maintenance is dormant—no updates in over 900 days—so consider it only if the current feature set meets your needs and you're comfortable with no active support.
Install
solus on PyPI
pip
pip install solusuv
uv add soluspoetry
poetry add solusInstalling solus
Before you install
Low install friction with a pure Python wheel. Maintenance is dormant—last release was 2024-02-26, over 900 days ago—but the package is marked stable and has no known vulnerabilities.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal restrictions, making it safe for both open-source and commercial projects.
Quickstart
pip install solus
from solus import Singleton
class MyService(Singleton):
pass
service = MyService() # thread-safe single instance
Requires Python 3.8 or above.
Verify before relying
- Whether thread-safety guarantees hold under all Python concurrency models (asyncio, threading, multiprocessing).
- Performance characteristics compared to alternative singleton implementations.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — named |
| Maintenance | dormant — 900 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 115,304/month — #12,259 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: solus-1.2.2-py3-none-any.whl
Keywords: python, singleton
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
singleton-decoratorProvides a decorator that enforces singleton…
copyleft · top 15,000 on PyPI
pyjon.utilsProvides utility classes for Python…
permissive · top 15,000 on PyPI
sentinelCreates singleton sentinel objects that…
permissive · top 15,000 on PyPI
mixed-methodsProvides a decorator that lets a single method…
permissive · top 15,000 on PyPI
niltypeProvides a `Nil` singleton object to represent…
permissive · top 15,000 on PyPI
django-soloDjango Solo provides a base model class and…
unclear · top 15,000 on PyPI
slackA dependency injection container that registers…
permissive · top 15,000 on PyPI
celery-singletonPrevents duplicate Celery tasks from being…
permissive · top 15,000 on PyPI
pytest-run-parallelA pytest plugin that runs test functions…
permissive · top 15,000 on PyPI
wrapsProvides type-safe wrapper types for…
permissive · top 15,000 on PyPI