Skip to main content

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)

Source distribution for singleton-package 0.8.2
File Size Uploaded Provenance Actions
singleton_package-0.8.2.tar.gz 4.3 kB Without provenance Details for singleton_package-0.8.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for singleton-package 0.8.2
File Interpreter ABI Platform Actions
singleton_package-0.8.2-py3-none-any.whl Python 3 none any Details for singleton_package-0.8.2-py3-none-any.whl

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

Security for singleton-package 0.8.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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