singleton-package


Namesingleton-package JSON
Version 0.6.0 PyPI version JSON
download
home_pageNone
SummaryA simple Python package to create singleton objects
upload_time2024-06-24 02:48:19
maintainerNone
docs_urlNone
authorNone
requires_python>=3
licenseCopyright (c) 2024 Mahdi Kiani Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords singleton design pattern
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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:

```bash
pip install singleton_package
```

## Usage
To use the Singleton metaclass in your classes, simply specify Singleton as the metaclass:

```python
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](https://opensource.org/license/mit) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "singleton-package",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": "Mahdi Kiani <mahdikiany@gmail.com>",
    "keywords": "singleton, design pattern",
    "author": null,
    "author_email": "Mahdi Kiani <mahdikiany@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/bf/76/fbb68e2d0c3ff80b07976afd6cd67445298189aa10bc97ad90adc8ce7789/singleton_package-0.6.0.tar.gz",
    "platform": null,
    "description": "# Singleton Package\n\nThe `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.\n\n## Installation\n\nYou can install the `singleton_package` using pip:\n\n```bash\npip install singleton_package\n```\n\n## Usage\nTo use the Singleton metaclass in your classes, simply specify Singleton as the metaclass:\n\n```python\nfrom singleton import Singleton\n\nclass MyClass(metaclass=Singleton):\n    def __init__(self):\n        # Your initialization code here\n        pass\n\n# Usage\ninstance1 = MyClass()\ninstance2 = MyClass()\n\n# instance1 and instance2 will be the same object\nassert instance1 is instance2\n```\n\n## Contributing\nContributions are welcome! Please feel free to submit pull requests or report any issues you encounter.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://opensource.org/license/mit) file for details.\n",
    "bugtrack_url": null,
    "license": "Copyright (c) 2024 Mahdi Kiani  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "A simple Python package to create singleton objects",
    "version": "0.6.0",
    "project_urls": {
        "Bug Reports": "https://github.com/mahdikiani/singleton_package/issues",
        "Homepage": "https://github.com/mahdikiani/singleton_package",
        "Say Thanks!": "https://saythanks.io/to/mahdikiani",
        "Source": "https://github.com/mahdikiani/singleton_package"
    },
    "split_keywords": [
        "singleton",
        " design pattern"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8e39951addfae926e874a3d33f5815bffcc0dd4f0531a974d553140275376c5f",
                "md5": "31fa96b0ea8863aace3bbb5227febd10",
                "sha256": "91541c94f3b9ceabbfb2e481a061ef5f2b7d450a1965151c34de0de3c68a9f96"
            },
            "downloads": -1,
            "filename": "singleton_package-0.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "31fa96b0ea8863aace3bbb5227febd10",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3",
            "size": 4061,
            "upload_time": "2024-06-24T02:48:17",
            "upload_time_iso_8601": "2024-06-24T02:48:17.358635Z",
            "url": "https://files.pythonhosted.org/packages/8e/39/951addfae926e874a3d33f5815bffcc0dd4f0531a974d553140275376c5f/singleton_package-0.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bf76fbb68e2d0c3ff80b07976afd6cd67445298189aa10bc97ad90adc8ce7789",
                "md5": "09d42a49012a9190fd9b34679adcef76",
                "sha256": "7fa7e974e591319d29d5aa14c383cd835538cc823213db2e3a52e8a51fa68e8b"
            },
            "downloads": -1,
            "filename": "singleton_package-0.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "09d42a49012a9190fd9b34679adcef76",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 3432,
            "upload_time": "2024-06-24T02:48:19",
            "upload_time_iso_8601": "2024-06-24T02:48:19.008105Z",
            "url": "https://files.pythonhosted.org/packages/bf/76/fbb68e2d0c3ff80b07976afd6cd67445298189aa10bc97ad90adc8ce7789/singleton_package-0.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-24 02:48:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mahdikiani",
    "github_project": "singleton_package",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "singleton-package"
}
        
Elapsed time: 0.28212s