Skip to main content

Singleton metaclasses and singleton factories

Project description

Declaring singleton classes and singleton factories with different scopes of instantiation, striving for thread-safety and simplicity.

  • Free software: MIT license


pip install singletons

Quick Example

    import singletons

def my_uuid():
    return uuid.uuid4()

# elsewhere...
my_uuid()  # will return the global instance of a UUID object


To run the all tests run:




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.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for singletons, version 0.2.3
Filename, size File type Python version Upload date Hashes
Filename, size singletons-0.2.3-py2.py3-none-any.whl (6.7 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size singletons-0.2.3.tar.gz (15.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page