{ "info": { "author": "Phoenix Zerin", "author_email": "phx@phx.ph", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": ".. image:: https://travis-ci.org/todofixthis/class-registry.svg?branch=master\n :target: https://travis-ci.org/todofixthis/class-registry\n.. image:: https://readthedocs.org/projects/class-registry/badge/?version=latest\n :target: http://class-registry.readthedocs.io/\n\nClassRegistry\n=============\nAt the intersection of the Registry and Factory patterns lies the\n``ClassRegistry``:\n\n- Define global factories that generate new class instances based on\n configurable keys.\n- Seamlessly create powerful service registries.\n- Integrate with setuptools's ``entry_points`` system to make your registries\n infinitely extensible by 3rd-party libraries!\n- And more!\n\n\nGetting Started\n---------------\nCreate a registry using the ``class_registry.ClassRegistry`` class, then\ndecorate any classes that you wish to register with its ``register`` method:\n\n.. code-block:: python\n\n from class_registry import ClassRegistry\n\n pokedex = ClassRegistry()\n\n @pokedex.register('fire')\n class Charizard(Pokemon):\n ...\n\n @pokedex.register('grass')\n class Bulbasaur(Pokemon):\n ...\n\n @pokedex.register('water')\n class Squirtle(Pokemon):\n ...\n\nTo create a class instance from a registry, use the subscript operator:\n\n.. code-block:: python\n\n # Charizard, I choose you!\n fighter1 = pokedex['fire']\n\n # CHARIZARD fainted!\n # How come my rival always picks the type that my pok\u00e9mon is weak against??\n fighter2 = pokedex['grass']\n\n\nAdvanced Usage\n~~~~~~~~~~~~~~\nThere's a whole lot more you can do with ClassRegistry, including:\n\n- Provide args and kwargs to new class instances.\n- Automatically register non-abstract classes.\n- Integrate with setuptools's ``entry_points`` system so that 3rd-party\n libraries can add their own classes to your registries.\n- Wrap your registry in an instance cache to create a service registry.\n- And more!\n\nFor more advanced usage, check out the documentation on `ReadTheDocs`_!\n\n\nRequirements\n------------\nClassRegistry is compatible with the following Python versions:\n\n- 3.8\n- 3.7\n- 3.6\n- 3.5\n\npypy3 is also supported.\n\n.. note::\n ClassRegistry is **not** compatible with Python 2.\n\nInstallation\n------------\nInstall the latest stable version via pip::\n\n pip install phx-class-registry\n\n\nRunning Unit Tests\n------------------\nTo run unit tests after installing from source::\n\n python setup.py test\n\nThis project is also compatible with `tox`_, which will run the unit tests in\ndifferent virtual environments (one for each supported version of Python).\n\nInstall the package with the ``test-runner`` extra to set up the necessary\ndependencies, and then you can run the tests with the ``tox`` command::\n\n pip install -e .[test-runner]\n tox -p all\n\nDocumentation\n-------------\nDocumentation is available on `ReadTheDocs`_.\n\nIf you are installing from source (see above), you can also build the\ndocumentation locally:\n\n#. Install extra dependencies (you only have to do this once)::\n\n pip install '.[docs-builder]'\n\n#. Switch to the ``docs`` directory::\n\n cd docs\n\n#. Build the documentation::\n\n make html\n\n\n.. _ReadTheDocs: https://class-registry.readthedocs.io/\n.. _tox: https://tox.readthedocs.io/\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://class-registry.readthedocs.io/", "keywords": "registry pattern", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "phx-class-registry", "package_url": "https://pypi.org/project/phx-class-registry/", "platform": "", "project_url": "https://pypi.org/project/phx-class-registry/", "project_urls": { "Homepage": "https://class-registry.readthedocs.io/" }, "release_url": "https://pypi.org/project/phx-class-registry/3.0.5/", "requires_dist": [ "sphinx ; extra == 'docs-builder'", "sphinx-rtd-theme ; extra == 'docs-builder'", "tox (>=3.7) ; extra == 'test-runner'" ], "requires_python": "", "summary": "Factory+Registry pattern for Python classes.", "version": "3.0.5" }, "last_serial": 5751859, "releases": { "3.0.3": [ { "comment_text": "", "digests": { "md5": "7f310432a2c394f521073c2d4fff88ca", "sha256": "f32f57ed51e6c1a9b4d127fafed4c3d296be66f2c4173360d34c4f2c36489f3d" }, "downloads": -1, "filename": "phx_class_registry-3.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "7f310432a2c394f521073c2d4fff88ca", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11562, "upload_time": "2019-08-29T11:47:34", "url": "https://files.pythonhosted.org/packages/c5/37/9cd4cbca2ce6afc68c7cbbd62848adb1fdb86516301e991019ae5a9e11c9/phx_class_registry-3.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bff309a6289475b69b5e7cb0526df594", "sha256": "4159708e900208abb1abd6907f2c5d014781cb52db52d8cfcd2b21bf229f909b" }, "downloads": -1, "filename": "phx-class-registry-3.0.3.tar.gz", "has_sig": false, "md5_digest": "bff309a6289475b69b5e7cb0526df594", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15887, "upload_time": "2019-08-29T11:47:36", "url": "https://files.pythonhosted.org/packages/0b/60/ff5041ffd63e031741944899005955b0c37a1a35d39cda383b5f9bb728ec/phx-class-registry-3.0.3.tar.gz" } ], "3.0.4": [ { "comment_text": "", "digests": { "md5": "9966d51dbc5f34fa70892f8c306f05c0", "sha256": "f45166d806e424ceedf9460b1252d0e73cf6454ce089be975a4ebaf0ef6a1194" }, "downloads": -1, "filename": "phx_class_registry-3.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "9966d51dbc5f34fa70892f8c306f05c0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11584, "upload_time": "2019-08-29T11:58:31", "url": "https://files.pythonhosted.org/packages/8c/cf/f2d2174dbf353a3e28f3fc2c9601cb626d65965323f8fa4a3d4f2099f4fa/phx_class_registry-3.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "08aacf15bdd37097ec866197f7035f22", "sha256": "595afa87624c26ec61f03f9af37b2beaef92b84e2103c607a792845bc7830dbd" }, "downloads": -1, "filename": "phx-class-registry-3.0.4.tar.gz", "has_sig": false, "md5_digest": "08aacf15bdd37097ec866197f7035f22", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15921, "upload_time": "2019-08-29T11:58:32", "url": "https://files.pythonhosted.org/packages/ad/7e/3cdd8a187ab7802515825752ba997e185838f793629733d5926725106d71/phx-class-registry-3.0.4.tar.gz" } ], "3.0.5": [ { "comment_text": "", "digests": { "md5": "be703ca17ef80fdf9a0ed404547630c1", "sha256": "ebb6aa3d232f1a5081a00dab2551693bb39ac78359e01b42a9c157ef9a5f85ef" }, "downloads": -1, "filename": "phx_class_registry-3.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "be703ca17ef80fdf9a0ed404547630c1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11515, "upload_time": "2019-08-29T12:04:55", "url": "https://files.pythonhosted.org/packages/32/70/666e3ccf2e8b49c3cabd807570b3e410d9fbda9dcae15421f656a770d377/phx_class_registry-3.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "58b669e9e5f312ea2fa0b0fd7c4752af", "sha256": "f11462ac410a8cda38c2b6a83b51a2390c7d9528baef591cb5b551b11aba2a92" }, "downloads": -1, "filename": "phx-class-registry-3.0.5.tar.gz", "has_sig": false, "md5_digest": "58b669e9e5f312ea2fa0b0fd7c4752af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15758, "upload_time": "2019-08-29T12:04:57", "url": "https://files.pythonhosted.org/packages/ea/48/b1acdd934f89377fd047401f02c301b938f4962f5af30b8ad7224487c412/phx-class-registry-3.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "be703ca17ef80fdf9a0ed404547630c1", "sha256": "ebb6aa3d232f1a5081a00dab2551693bb39ac78359e01b42a9c157ef9a5f85ef" }, "downloads": -1, "filename": "phx_class_registry-3.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "be703ca17ef80fdf9a0ed404547630c1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11515, "upload_time": "2019-08-29T12:04:55", "url": "https://files.pythonhosted.org/packages/32/70/666e3ccf2e8b49c3cabd807570b3e410d9fbda9dcae15421f656a770d377/phx_class_registry-3.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "58b669e9e5f312ea2fa0b0fd7c4752af", "sha256": "f11462ac410a8cda38c2b6a83b51a2390c7d9528baef591cb5b551b11aba2a92" }, "downloads": -1, "filename": "phx-class-registry-3.0.5.tar.gz", "has_sig": false, "md5_digest": "58b669e9e5f312ea2fa0b0fd7c4752af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15758, "upload_time": "2019-08-29T12:04:57", "url": "https://files.pythonhosted.org/packages/ea/48/b1acdd934f89377fd047401f02c301b938f4962f5af30b8ad7224487c412/phx-class-registry-3.0.5.tar.gz" } ] }