Metadata-Version: 2.1
Name: pattern_singleton
Version: 1.1.0
Summary: Metaclass Singleton Pattern (supports Multi-thread).
Home-page: https://github.com/MarcinMysliwiec/pattern_singleton
Author: Marcin Mysliwiec
Author-email: marcin.mysliw@gmail.com
License: MIT license
Description: =================
        Pattern Singleton
        =================
        
        .. image:: https://img.shields.io/pypi/pyversions/pattern_singleton
                :target: https://pypi.python.org/pypi/pattern_singleton
                :alt: Python
        
        .. image:: https://img.shields.io/pypi/v/pattern_singleton.svg?color=brightgreen
                :target: https://pypi.python.org/pypi/pattern_singleton
                :alt: PyPi
        
        .. image:: https://img.shields.io/pypi/l/pattern_singleton?color=brightgreen
                :target: https://github.com/MarcinMysliwiec/pattern_singleton/blob/master/LICENSE
                :alt: License
        
        .. image:: https://travis-ci.com/MarcinMysliwiec/pattern_singleton.svg
                :target: https://travis-ci.com/MarcinMysliwiec/pattern_singleton
                :alt: Build
        
        .. image:: https://codecov.io/gh/MarcinMysliwiec/pattern_singleton/branch/master/graph/badge.svg?token=ZJCBWXAJPR
                :target: https://codecov.io/gh/MarcinMysliwiec/pattern_singleton
                :alt: Coverage
        
        Description
        ~~~~~~~~~~~~
        
        Singleton is a creational design pattern that lets you ensure that a class has only one instance, while providing a global access point to this instance.
        This implementation of Singleton Design Pattern is based on metaclass method.
        
        * Free software: `MIT <https://github.com/MarcinMysliwiec/pattern_singleton/blob/master/LICENSE>`__ license
        * But I would appreciate a star on `GitHub <https://github.com/MarcinMysliwiec>`__
        
        Multithreaded
        ~~~~~~~~~~~~~~~~
        
        This method provide proper handling for multi-thread environment by closing public threading lock while creating instance of Singleton subclass.
        
        Installation
        ~~~~~~~~~~~~
        
        Just use (No other package is needed):
        
        .. code-block:: sh
        
            $ pip install pattern-singleton
        
        
        Example Usage
        ~~~~~~~~~~~~~
        
        .. code-block:: python
        
            from pattern_singleton import Singleton
        
        
            class Example(metaclass=Singleton):
                def __init__(self):
                    self.variable = 1
        
        
            if __name__ == '__main__':
                example_01 = Example()
                example_02 = Example()
        
                print(example_01.variable)  # displays 1
                print(example_02.variable)  # displays 1
        
                example_01.variable = 2     # changes value for every instance of Example class
        
                print(example_01.variable)  # displays 2
                print(example_02.variable)  # displays 2
        
        
        Credits
        -------
        
        This package was created by `Marcin Mysliwiec <https://github.com/MarcinMysliwiec>`__ with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
        
        .. _Cookiecutter: https://github.com/audreyr/cookiecutter
        .. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
        
        
        =======
        History
        =======
        
        1.1.0
        ~~~~~~~~~~~~~~~~~~~
        
        * Multi thread support
        
        1.0.1
        ~~~~~~~~~~~~~~~~~~~
        
        * Documentation refactor
        
        1.0.0
        ~~~~~~~~~~~~~~~~~~~
        
        * Release pattern-singleton
        
        
        0.1.0
        ~~~~~~~~~~~~~~~~~~~
        
        * Refactor `patternSingleton <https://pypi.org/project/patternSingleton/>`__ to `pattern_singleton <https://pypi.org/project/pattern_singleton/>`__
        
Keywords: pattern_singleton,singleton,design,pattern,metaclass,multi-thread
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Requires-Python: >=3.6
Description-Content-Type: text/x-rst
