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

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

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.

Source Distribution

singletons-0.2.0.tar.gz (15.4 kB view details)

Uploaded Source

File details

Details for the file singletons-0.2.0.tar.gz.

File metadata

  • Download URL: singletons-0.2.0.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for singletons-0.2.0.tar.gz
Algorithm Hash digest
SHA256 54ea32d23e767c93ae003262699125428935cbdd0e0fd87435fa61d50dda520b
MD5 2813d0b93ebd47e7d5a9f292a8c2deca
BLAKE2b-256 79153af3abbee649f8509c2850b3933426e9c4053c6e7f655e147ecb0dd1a564

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page