{ "info": { "author": "Dan Elias", "author_email": "daniel@elias-family.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Natural Language :: English", "Programming Language :: Python :: 3" ], "description": ".. image:: https://readthedocs.org/projects/drytools/badge/?version=latest\n :target: https://drytools.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation status unknown\n\n.. image:: https://travis-ci.org/dan-elias/drytools.svg?branch=master\n :target: https://travis-ci.org/dan-elias/drytools\n :alt: Build status unknown\n\n===============================\nDRYtools\n===============================\n\nversion number: 0.1.3\n\nauthor: Dan Elias\n\nThis library provides tools to make Python code shorter, less repetitive and\nmore readable.\n\nFeatures\n--------\n\n* function annotations to coerce and/or validate parameters, and\n* decorators and mixins to add groups of Python standard methods to classes\n\nExample\n-------\n\nThis example provides implementation with and without drytools for a class\nrepresenting a person's name and age. The required behaviour is:\n\n* The constructor should accept a name and an age\n\n - age should be coerced to an integer\n - if name is not of type str, raise a TypeError\n - if age is negative or exceeds 200, raise a ValueError\n\n* The full set of comparison methods (ie: __lt__, __eq__ etc) should be\n implemented reflecting an ordering by age (with alphabetical ordering\n by name for people with the same age)\n\nWithout drytools\n^^^^^^^^^^^^^^^^\n\n.. code:: python\n\n from functools import total_ordering\n\n @total_ordering\n class person:\n def __init__(self, name, age):\n if not isinstance(name, str):\n raise TypeError(name)\n age = int(age)\n if (age < 0) or (age > 200):\n raise ValueError(age)\n self.name = name\n self.age = age\n def _comp(self):\n return (self.age, self.name)\n def __eq__(self, other):\n return self._comp() == other._comp()\n def __gt__(self, other):\n return self._comp() > other._comp()\n\nWith drytools\n^^^^^^^^^^^^^\n\n.. code:: python\n\n from operator import ge, le\n from drytools import args2attrs, check, compose_annotations, ordered_by\n\n @ordered_by('age', 'name')\n class person:\n @compose_annotations\n @args2attrs\n def __init__(self, name: check(isinstance, str, raises=TypeError),\n age:(int, check(ge, 0), check(le, 200))):\n pass\n\n\nGetting started\n---------------\n\n.. code-block:: bash\n\n $ pip install drytools\n\nDocumentation\n-------------\n\n.. image:: https://readthedocs.org/projects/drytools/badge/?version=latest\n :target: https://drytools.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation status unknown\n\nhttps://drytools.readthedocs.io/en/latest/\n\nContributing\n------------\n\n* Issue Tracker: https://github.com/dan-elias/drytools/issues\n* Source Code: https://github.com/dan-elias/drytools.git\n\nContinuous integration\n-----------------------\n\n.. image:: https://travis-ci.org/dan-elias/drytools.svg?branch=master\n :target: https://travis-ci.org/dan-elias/drytools\n :alt: Build status unknown\n\nhttps://travis-ci.org/dan-elias/drytools\n\n\nLicense\n-------\n\nThe project is licensed under the `GPL-3 `_ license.\n\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "https://github.com/dan-elias/drytools/tarball/0.1.3", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dan-elias/drytools", "keywords": "", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "drytools", "package_url": "https://pypi.org/project/drytools/", "platform": "", "project_url": "https://pypi.org/project/drytools/", "project_urls": { "Download": "https://github.com/dan-elias/drytools/tarball/0.1.3", "Homepage": "https://github.com/dan-elias/drytools" }, "release_url": "https://pypi.org/project/drytools/0.1.3/", "requires_dist": null, "requires_python": "", "summary": "Tools for reducing repetition in Python code", "version": "0.1.3" }, "last_serial": 4013813, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "ce34c07d8529acfb8c9d438f14bf0e59", "sha256": "28d31714f4e7c473d23cc11f9aa40152b81f381c8e9cbfde436f89a36ce2c918" }, "downloads": -1, "filename": "drytools-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ce34c07d8529acfb8c9d438f14bf0e59", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9054, "upload_time": "2018-06-29T03:06:27", "url": "https://files.pythonhosted.org/packages/8f/d4/65e98444dc0e72483223824f4de11e4689a77594dc20c0ee32af0070fdaa/drytools-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "011f33a6a04a308efe6cb1f4fb30cb46", "sha256": "066e173eb35bc8cb28120f91f0ac18fe130473fe6b5d4631305db1c5e056ff6a" }, "downloads": -1, "filename": "drytools-0.1.0.tar.gz", "has_sig": false, "md5_digest": "011f33a6a04a308efe6cb1f4fb30cb46", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7269, "upload_time": "2018-06-29T00:49:34", "url": "https://files.pythonhosted.org/packages/78/4a/aa936b1fdd62c63612bb70156fa5a3a60d5471e43a4d2e5dce25f04feccb/drytools-0.1.0.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "d8086cae83edeb399f776d363f99bbe3", "sha256": "2d8dbc6da77bbbcb3d8a34fb0bd99e84b66c3afb66191f8799572e3a093bfcf5" }, "downloads": -1, "filename": "drytools-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d8086cae83edeb399f776d363f99bbe3", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9053, "upload_time": "2018-06-29T03:14:56", "url": "https://files.pythonhosted.org/packages/13/1e/86d3a2a8f1763444db7a349452bc36cec9ebb5912e9d7ad42de9f93aa688/drytools-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8a10dc01396470c161624ef9ce5798b2", "sha256": "589a942d3c1bddaddfd627367e1fae6c0de97d51b5f51a01daf1e8ed133c72fa" }, "downloads": -1, "filename": "drytools-0.1.2.tar.gz", "has_sig": false, "md5_digest": "8a10dc01396470c161624ef9ce5798b2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7262, "upload_time": "2018-06-29T03:14:57", "url": "https://files.pythonhosted.org/packages/31/77/ee13c9e408ec785f5c47ca00ef3711c4f30d47a5611c6c0c82f1719c2249/drytools-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "a39679be8d38d8260f415921f253ed7b", "sha256": "08ef108e02fbcffd9839fd53f5a9b15ee5bf807f7312ba768aab733e9c3de7f5" }, "downloads": -1, "filename": "drytools-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a39679be8d38d8260f415921f253ed7b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9053, "upload_time": "2018-06-29T03:20:00", "url": "https://files.pythonhosted.org/packages/ea/66/0848b50ae62bbf6d384040877cd12ed0041904d4a06347b3fe15a96552f0/drytools-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ef0d49c1a84643a5ab18b462d8320560", "sha256": "8b55815898987564f399d1054ee1dcbaae1616067d7721b80280c3c139fbda0e" }, "downloads": -1, "filename": "drytools-0.1.3.tar.gz", "has_sig": false, "md5_digest": "ef0d49c1a84643a5ab18b462d8320560", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7259, "upload_time": "2018-06-29T03:20:02", "url": "https://files.pythonhosted.org/packages/ee/b0/db613832a9f333db31d054e73a13dce5667f793a20494faf8b1ddbcdc833/drytools-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a39679be8d38d8260f415921f253ed7b", "sha256": "08ef108e02fbcffd9839fd53f5a9b15ee5bf807f7312ba768aab733e9c3de7f5" }, "downloads": -1, "filename": "drytools-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a39679be8d38d8260f415921f253ed7b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9053, "upload_time": "2018-06-29T03:20:00", "url": "https://files.pythonhosted.org/packages/ea/66/0848b50ae62bbf6d384040877cd12ed0041904d4a06347b3fe15a96552f0/drytools-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ef0d49c1a84643a5ab18b462d8320560", "sha256": "8b55815898987564f399d1054ee1dcbaae1616067d7721b80280c3c139fbda0e" }, "downloads": -1, "filename": "drytools-0.1.3.tar.gz", "has_sig": false, "md5_digest": "ef0d49c1a84643a5ab18b462d8320560", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7259, "upload_time": "2018-06-29T03:20:02", "url": "https://files.pythonhosted.org/packages/ee/b0/db613832a9f333db31d054e73a13dce5667f793a20494faf8b1ddbcdc833/drytools-0.1.3.tar.gz" } ] }