Singleton Package
The singleton_package is a simple Python package that provides a Singleton metaclass. This metaclass can be used to create singleton objects, ensuring that only one instance of a class exists throughout the application.
Installation
You can install the singleton_package using pip:
pip install singleton_package
Usage
To use the Singleton metaclass in your classes, simply specify Singleton as the metaclass:
from singleton import Singleton
class MyClass(metaclass=Singleton):
def __init__(self):
# Your initialization code here
pass
# Usage
instance1 = MyClass()
instance2 = MyClass()
# instance1 and instance2 will be the same object
assert instance1 is instance2
Contributing
Contributions are welcome! Please feel free to submit pull requests or report any issues you encounter.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for singleton-package 0.8.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| singleton_package-0.8.2.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| singleton_package-0.8.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.5 kB
Release files / singleton_package-0.8.2.tar.gz
| Download URL | singleton_package-0.8.2.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52ae82564dab937dd92aa69bbfcf0da00a1bdef4b67f2679d539a3af64e33cf4
|
|
BLAKE2b-256 checksum How to use checksums |
eb86f77d3d3f0d868ff11f4d293e1d38078eacfaa569662e27a42b27ee51309f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / singleton_package-0.8.2-py3-none-any.whl
| Download URL | singleton_package-0.8.2-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ba0db5c0ad31f07cfb1a7eae320cb092db15fe4ab0b65b004bd693ccc0889ced
|
|
BLAKE2b-256 checksum How to use checksums |
016d1b4c6e953bfb2e01719d2bb84bab4e7ca01018656e57a2685094580a7530
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|