--- id: solus version: "1.2.2" license: MIT license_treatment: permissive maintenance: dormant --- # solus — Singleton types. License: permissive · Maintenance: dormant · Downloads: 115.3K/mo ## 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 above — 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 pip install solus uv add solus 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_current - Install friction: low - Maintenance: dormant - Downloads: 115.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags singleton pattern python, thread-safe singleton, singleton decorator, single instance class, singleton implementation, thread-unsafe singleton, singleton metaclass, design-pattern, singleton, thread-safe [View on SkillFed](https://skillfed.io/packages/solus) · [View on PyPI](https://pypi.org/project/solus/)