{ "info": { "author": "Jeremy Satterfield", "author_email": "jsatt@jsatt.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development" ], "description": "Python Catalog\n==============\n\n.. image:: https://badge.fury.io/py/pycatalog.svg\n :target: https://badge.fury.io/py/pycatalog\n\n.. image:: https://travis-ci.org/jsatt/python-catalog.svg?branch=master\n :target: https://travis-ci.org/jsatt/python-catalog\n\nCatalog is a data structure for storing complex enumeration. It provides a clean definition pattern and several options for member lookup.\n\nSupports Python 2.7, 3.3+\n\nInstall\n-------\n\n::\n\n pip install pycatalog\n\nUsage\n-----\n\n::\n\n from catalog import Catalog\n\n class Color(Catalog):\n _attrs = 'value', 'label', 'other'\n red = 1, 'Red', 'stuff'\n blue = 2, 'Blue', 'things'\n\n # Access values as Attributes\n > Color.red.value\n 1\n > Color.red.label\n 'Red'\n\n # Call to look up members by attribute value\n > Color('Blue', 'label')\n Color.blue\n\n # Calling without attribute specified assumes first attribute defined in `_attrs`\n > Color(1)\n Color.red\n\nAttributes\n~~~~~~~~~~\n\n``_attrs``: Defines names of attributes of members. (default: ``['value']``)\n\n``_member_class``: Override the class used to create members. Create a custom member class by extending ``CatalogMember``.\n\nMethods\n~~~~~~~\n\n``_zip``: Return all members as a tuple. If attrs are provided as positional arguments, only those\nattributes will be included, and in that order. Otherwise all attributes are included followed by\nthe member name.\n\n::\n\n > Color._zip()\n (('red', 1, 'Red', 'stuff'), ('blue', 2, 'Blue', 'things'))\n > Colot._zip('value', 'label')\n ((1, 'Red'), (2, 'Blue'))\n\nChangelog\n---------\n\n1.2.0 - Add support for Python 2. (Wrong direction. I know)\n\n1.1.1 - Add ``_zip`` method\n\n1.0.0 - Initial build and packaging\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jsatt/python-catalog", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "pycatalog", "package_url": "https://pypi.org/project/pycatalog/", "platform": "", "project_url": "https://pypi.org/project/pycatalog/", "project_urls": { "Homepage": "https://github.com/jsatt/python-catalog" }, "release_url": "https://pypi.org/project/pycatalog/1.2.0/", "requires_dist": null, "requires_python": "", "summary": "Data structure for complexe enumeration.", "version": "1.2.0" }, "last_serial": 3141267, "releases": { "1.1.0": [ { "comment_text": "", "digests": { "md5": "914965a47b49b708dec32f7f6aaccd5b", "sha256": "e959220fd61d298b8742af984bbf05c181d5736beff11e08bbbd05902b0291d3" }, "downloads": -1, "filename": "pycatalog-1.1.0.tar.gz", "has_sig": false, "md5_digest": "914965a47b49b708dec32f7f6aaccd5b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2698, "upload_time": "2015-11-23T21:40:47", "url": "https://files.pythonhosted.org/packages/8c/5f/8b4f36d2148c798f7ae20a48ff7b2698de4dc90891263a6f1738ed3920e9/pycatalog-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "3d67534bf659413aa98ef2978dcd8b2d", "sha256": "4c1d5ae0d72e7178afde2a5896a342f0ab9ab1247c9d7defa2d94d582b73699f" }, "downloads": -1, "filename": "pycatalog-1.1.1.tar.gz", "has_sig": false, "md5_digest": "3d67534bf659413aa98ef2978dcd8b2d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3290, "upload_time": "2015-11-24T15:48:49", "url": "https://files.pythonhosted.org/packages/bd/ae/a4d7245c2d140549726ab6cfb9296c2416f434346de510307ee2b026c931/pycatalog-1.1.1.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "ae0b623c8881250ca0570b746ab4fb31", "sha256": "72bbcbc26aa6ae2797e6cbb3af80ec2adc814a9d65ff1e9346b4e9867c5b77fd" }, "downloads": -1, "filename": "pycatalog-1.2.0-py3.5.egg", "has_sig": false, "md5_digest": "ae0b623c8881250ca0570b746ab4fb31", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 6827, "upload_time": "2017-09-01T19:26:16", "url": "https://files.pythonhosted.org/packages/26/bf/531c485ab605b222fa84d39d04024128d3b6ff5cc380606174c500349d90/pycatalog-1.2.0-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "949de381440fc67067c20ad75cb5cc1c", "sha256": "d0cc1497cdc8a3dd82f2de26bba519955132b5853e85a831cf2f174c85ece986" }, "downloads": -1, "filename": "pycatalog-1.2.0.tar.gz", "has_sig": false, "md5_digest": "949de381440fc67067c20ad75cb5cc1c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4649, "upload_time": "2017-09-01T19:26:14", "url": "https://files.pythonhosted.org/packages/37/79/8ca814d4dc511216bbfa4fb009ec2717616c1ed5a292fa657f56845a0922/pycatalog-1.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ae0b623c8881250ca0570b746ab4fb31", "sha256": "72bbcbc26aa6ae2797e6cbb3af80ec2adc814a9d65ff1e9346b4e9867c5b77fd" }, "downloads": -1, "filename": "pycatalog-1.2.0-py3.5.egg", "has_sig": false, "md5_digest": "ae0b623c8881250ca0570b746ab4fb31", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 6827, "upload_time": "2017-09-01T19:26:16", "url": "https://files.pythonhosted.org/packages/26/bf/531c485ab605b222fa84d39d04024128d3b6ff5cc380606174c500349d90/pycatalog-1.2.0-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "949de381440fc67067c20ad75cb5cc1c", "sha256": "d0cc1497cdc8a3dd82f2de26bba519955132b5853e85a831cf2f174c85ece986" }, "downloads": -1, "filename": "pycatalog-1.2.0.tar.gz", "has_sig": false, "md5_digest": "949de381440fc67067c20ad75cb5cc1c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4649, "upload_time": "2017-09-01T19:26:14", "url": "https://files.pythonhosted.org/packages/37/79/8ca814d4dc511216bbfa4fb009ec2717616c1ed5a292fa657f56845a0922/pycatalog-1.2.0.tar.gz" } ] }