{ "info": { "author": "Alexander Artemenko", "author_email": "svetlyak.40wt@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Utilities" ], "description": "========\nOverview\n========\n\n\n\nA magic shortcut to generate __repr__ methods for your classes.\n\n* Free software: BSD license\n\nInstallation\n============\n\n::\n\n pip install repr\n\nThis package contains a single module ``magic_repr`` called so\nto not conflict with standart python's ``repr``.\n\nReasoning\n=========\n\nWhat do you think each time, writing such code?\n\n.. code:: python\n\n def __repr__(self):\n return \"\"\"\n Issue(changelog={self.changelog},\n type={self.type},\n comment={self.comment},\n created_at={self.created_at},\n resolved_at={self.resolved_at})\"\"\".format(self=self).strip().encode('utf-8')\n\nIsn't this much better and readable?\n\n.. code:: python\n\n __repr__ = make_repr('changelog', 'type', 'comment', 'created_at', 'resolved_at')\n\n\nAnd this produces much nicer output:\n\n.. code:: python\n\n \n type=u'wrong-version-content'\n comment=u'AllMyChanges should take release notes from the web site.'\n created_at=datetime.datetime(2016, 6, 17, 6, 44, 52, 16760, tzinfo=)\n resolved_at=None>\n\nAnother advantage of the magic_repr\n-----------------------------------\n\nIs it's recursiveness. If you use ``magic_repr`` for your objects and they\ninclude each other, then representation of the parent object will include\nchild objects properly nested:\n\n.. code:: python\n\n ,\n 2: ,\n u'\u0442\u0440\u0438': }>\n\nAnd all this for free! Just do ``__repr__ = make_repr()``.\n\nUsage\n=====\n\nFor simple cases it is enough to call ``make_repr`` without arguments. It will figure out\nwhich attributes object has and will output them sorted alphabetically.\n\nYou can also specify which attributes you want to include in \"representaion\":\n\n.. code:: python\n\n from magic_repr import make_repr\n\n __repr__ = make_repr('foo', 'bar')\n\nAnd to specify a function to create a value for an attribute, using keywords:\n\n.. code:: python\n\n from magic_repr import make_repr\n \n class Some(object):\n def is_active(self):\n return True\n\n Some.__repr__ = make_repr(active=Some.is_active)\n\nPay attention, that in this case ``__repr__`` was created after the class definition.\nThis is because inside of the class it can't reference itself.\n\nDocumentation\n=============\n\nhttps://python-repr.readthedocs.io/\n\nDevelopment\n===========\n\nTo run the all tests run::\n\n tox\n\nNote, to combine the coverage data from all the tox environments run:\n\n.. list-table::\n :widths: 10 90\n :stub-columns: 1\n\n - - Windows\n - ::\n\n set PYTEST_ADDOPTS=--cov-append\n tox\n\n - - Other\n - ::\n\n PYTEST_ADDOPTS=--cov-append tox\n\nChangelog\n=========\n\n0.3.1 (2016-06-22)\n------------------\n\n* Fixed issue #1 prevented generated __repr__ methods to work in mutithreaded programs.\n\n0.3.0 (2016-06-20)\n------------------\n\n* Now ``make_repr`` can be used for recursive datastructures.\n\n0.2.1 (2016-06-19)\n------------------\n\n* Documentation improved.\n\n0.2.0 (2016-06-19)\n------------------\n\n* Better handling of nested datastructure.\n* Callables as source of the attribute's value.\n* Some documentation.\n\n0.1.0 (2016-06-09)\n------------------\n\n* First release on PyPI.", "description_content_type": null, "docs_url": "https://pythonhosted.org/repr/", "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/svetlyak40wt/python-repr", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "repr", "package_url": "https://pypi.org/project/repr/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/repr/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/svetlyak40wt/python-repr" }, "release_url": "https://pypi.org/project/repr/0.3.1/", "requires_dist": null, "requires_python": null, "summary": "A shortcut to generate __repr__ methods for python classes", "version": "0.3.1" }, "last_serial": 2181227, "releases": { "0.1.0": [], "0.2.0": [ { "comment_text": "", "digests": { "md5": "1595c7039839344eecbd551aed4bd8b3", "sha256": "00a4090e7a7385cae77eed838cce8a3ffd3f9c38c34db9211a62906f84be68b6" }, "downloads": -1, "filename": "repr-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1595c7039839344eecbd551aed4bd8b3", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 7388, "upload_time": "2016-06-19T08:27:43", "url": "https://files.pythonhosted.org/packages/45/f1/4171b6845a2dbd95342a31fe66bc7dd6efc528fe04800bd874c28d622ed0/repr-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "16c8053130e2280c70bbdcbb13987b68", "sha256": "e250fee2090abb41df12488beb925fb7f1532c50276abb7e0e83b6770b23ee58" }, "downloads": -1, "filename": "repr-0.2.0.tar.gz", "has_sig": false, "md5_digest": "16c8053130e2280c70bbdcbb13987b68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16065, "upload_time": "2016-06-19T08:27:38", "url": "https://files.pythonhosted.org/packages/65/ad/c6dd480616ab193bf0dc9898022f3e506ba478d6dc17c0adeb5e55b6718d/repr-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "cdeb28ce6aa1f13d15c30e88625eba17", "sha256": "a8a9dc8a3a88e060c28a8c24ba57cb5d24cccc52ca36183d4f5e993f3f386e01" }, "downloads": -1, "filename": "repr-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "cdeb28ce6aa1f13d15c30e88625eba17", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 7436, "upload_time": "2016-06-19T08:51:51", "url": "https://files.pythonhosted.org/packages/2b/bd/45ed119b6ddd91e63a426b1782c340d2ef51572ac1d2dd0e7fd97d994089/repr-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3e1650c7ad230898bee3152345da88e3", "sha256": "0edf52372c6d81c8a1a28f7cab256b2b439c4254431e9992d39bb9328730633b" }, "downloads": -1, "filename": "repr-0.2.1.tar.gz", "has_sig": false, "md5_digest": "3e1650c7ad230898bee3152345da88e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16139, "upload_time": "2016-06-19T08:51:45", "url": "https://files.pythonhosted.org/packages/bd/32/7691526cf8cb8845e425dbb9a706b4215cd7350141b49d410275dc121cd5/repr-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "e06e959ea786f513e89bf8903b91d231", "sha256": "446510e21c4d28b59c0cd921f50d3d8ec6055bad0c58eaa5ac557cbe849b83f9" }, "downloads": -1, "filename": "repr-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e06e959ea786f513e89bf8903b91d231", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 7602, "upload_time": "2016-06-20T06:11:25", "url": "https://files.pythonhosted.org/packages/0e/d7/77b7bafee3481379ca52aab2b5767682030b4e866258eb3ea7dfbc9f5637/repr-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2b767b53431abebdbeacd63df5455c11", "sha256": "8dd5b900b228c6ee5ae3771bd959d610a69306b7681fef9f48664fdf2e1a5c2f" }, "downloads": -1, "filename": "repr-0.3.0.tar.gz", "has_sig": false, "md5_digest": "2b767b53431abebdbeacd63df5455c11", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15883, "upload_time": "2016-06-20T06:11:20", "url": "https://files.pythonhosted.org/packages/c3/b2/575363a9a4afe67e70de3c6e224251ade3a8b49429fad6ee195150d25db6/repr-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "7b9702738cbba20451d2fd224f29a27b", "sha256": "29f4c3a73f3a6d98551fe47759dbccf8a4f5c188622914f0449dd7e455196e74" }, "downloads": -1, "filename": "repr-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7b9702738cbba20451d2fd224f29a27b", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 7769, "upload_time": "2016-06-22T13:12:37", "url": "https://files.pythonhosted.org/packages/e9/fe/6421e10e77d544079bda49cc06f481a1ef5950a51e638025bb6701bed6ba/repr-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4c6c26cdd595d01502313b341a82deb9", "sha256": "0684f8cbf452d0b4f4f7eaba2eeb3ea3478bbf67153df3afbc796bd9f3914a87" }, "downloads": -1, "filename": "repr-0.3.1.tar.gz", "has_sig": false, "md5_digest": "4c6c26cdd595d01502313b341a82deb9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16236, "upload_time": "2016-06-22T13:12:33", "url": "https://files.pythonhosted.org/packages/cf/d9/891955bf9e29cd6ab1000b9c66cee157070ac74e172a738d3388719fb49a/repr-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7b9702738cbba20451d2fd224f29a27b", "sha256": "29f4c3a73f3a6d98551fe47759dbccf8a4f5c188622914f0449dd7e455196e74" }, "downloads": -1, "filename": "repr-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7b9702738cbba20451d2fd224f29a27b", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 7769, "upload_time": "2016-06-22T13:12:37", "url": "https://files.pythonhosted.org/packages/e9/fe/6421e10e77d544079bda49cc06f481a1ef5950a51e638025bb6701bed6ba/repr-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4c6c26cdd595d01502313b341a82deb9", "sha256": "0684f8cbf452d0b4f4f7eaba2eeb3ea3478bbf67153df3afbc796bd9f3914a87" }, "downloads": -1, "filename": "repr-0.3.1.tar.gz", "has_sig": false, "md5_digest": "4c6c26cdd595d01502313b341a82deb9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16236, "upload_time": "2016-06-22T13:12:33", "url": "https://files.pythonhosted.org/packages/cf/d9/891955bf9e29cd6ab1000b9c66cee157070ac74e172a738d3388719fb49a/repr-0.3.1.tar.gz" } ] }