Skip to main content

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

https://python-singletons.readthedocs.io/

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.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for singletons 0.2.4
File Size Uploaded
singletons-0.2.4.tar.gz 15.1 kB Details

Release files / singletons-0.2.4.tar.gz

Download URL singletons-0.2.4.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c4556c8bc35797a176467ef620721f0b1fcc84f37b3b6cd03432eab4ce3640a3
BLAKE2b-256 checksum
How to use checksums
e58edf837c660e4569d1658ca6a08c4e31899677c375a3d8fbb0b10b2f540cda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.5

Release history Release notifications | RSS feed

0.2.5

2 release files

This release

0.2.4 This release

1 release file

0.2.3

2 release files

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page