Overview
Declaring singleton classes and singleton factories with different scopes of instantiation, striving for thread-safety and simplicity.
Free software: MIT license
Installation
pip install singletons
Quick Example
import singletons
@singletons.GlobalFactory
def my_uuid():
return uuid.uuid4()
# elsewhere...
my_uuid() # will return the global instance of a UUID object
Documentation
Development
To run the all tests run:
tox
Changelog
master
0.2.2 (2018-02-01)
Shows warning rather than giving exception when using greenthread singletons without a greenthread environment
0.2.1 (2018-01-29)
CI changes
0.2.0 (2018-01-23)
More tests
Usage examples added to documentation
Fixed issues revealed by tests
0.1.0 (2018-01-22)
First release on PyPI.
Metadata
Release files for singletons 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| singletons-0.2.3.tar.gz | 15.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| singletons-0.2.3-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 22.4 kB
Release files / singletons-0.2.3.tar.gz
| Download URL | singletons-0.2.3.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
94b7e8a3edbae48e05f0ac960c6bc0aa7820702584732149ac73e5f81f23abfb
|
|
BLAKE2b-256 checksum How to use checksums |
fe6bcc87519118346dd5b3f7411cf8f0e669ab5bda16f7223cdc132105452027
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/28.8.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.4
|
Release files / singletons-0.2.3-py2.py3-none-any.whl
| Download URL | singletons-0.2.3-py2.py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
d1fa48be24bb301ae6f4a4be10f4a4535f4618b154aac26bb3b1d1e0996eb6cf
|
|
BLAKE2b-256 checksum How to use checksums |
b4305d42c24bf08ffcc931479c638a0eac841b65a480a5c4736959a28fcb2e30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/28.8.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.4
|