skillfed

solus

Singleton types.

solus v1.2.2 115.3K downloads/30d#12,259 on PyPI1
Permissive license MIT DORMANT released

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 solus

uv

uv add solus

poetry

poetry add solus

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: UtilitiesTyping :: Typed

Tags

singleton pattern pythonthread-safe singletonsingleton decoratorsingle instance classsingleton implementationthread-unsafe singletonsingleton metaclass
design-patternsingletonthread-safe

More Utilities packages