attr


Nameattr JSON
Version 0.3.2 PyPI version JSON
download
home_pagehttps://github.com/denis-ryzhkov/attr
SummarySimple decorator to set attributes of target function or class in a DRY way.
upload_time2022-07-13 08:24:30
maintainer
docs_urlNone
authorDenis Ryzhkov
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            

Usage example::

    # Django proposes:
    def my_calculated_field(...
    my_calculated_field.short_description = 'Field'
    my_calculated_field.admin_order_field = 'real_field'

    # DRY:
    @attr(short_description='Field', admin_order_field='real_field')
    def my_calculated_field(...

Get it::

    sudo pip install attr
    from attr import attr

New popular `attrs.org <http://attrs.org>`_ used by `pytest.org <https://pytest.org>`_ defines another "attr" package that shadows this "attr" module.

Please use "dry_attr" alias to unshadow it::

    from dry_attr import attr
    from dry_attr import dry_attr




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/denis-ryzhkov/attr",
    "name": "attr",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Denis Ryzhkov",
    "author_email": "denisr@denisr.com",
    "download_url": "https://files.pythonhosted.org/packages/e4/d2/d0a5e36049ec6f72f4951b7f843b359d21e5a208b120618686187234dd1d/attr-0.3.2.tar.gz",
    "platform": null,
    "description": "\n\nUsage example::\n\n    # Django proposes:\n    def my_calculated_field(...\n    my_calculated_field.short_description = 'Field'\n    my_calculated_field.admin_order_field = 'real_field'\n\n    # DRY:\n    @attr(short_description='Field', admin_order_field='real_field')\n    def my_calculated_field(...\n\nGet it::\n\n    sudo pip install attr\n    from attr import attr\n\nNew popular `attrs.org <http://attrs.org>`_ used by `pytest.org <https://pytest.org>`_ defines another \"attr\" package that shadows this \"attr\" module.\n\nPlease use \"dry_attr\" alias to unshadow it::\n\n    from dry_attr import attr\n    from dry_attr import dry_attr\n\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Simple decorator to set attributes of target function or class in a DRY way.",
    "version": "0.3.2",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "5f6f3a7286158b1400343403de204c2e",
                "sha256": "4f4bffeea8c27387bde446675a7ac24f3b8fea1075f12d849b5f5c5181fc8336"
            },
            "downloads": -1,
            "filename": "attr-0.3.2-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5f6f3a7286158b1400343403de204c2e",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 3267,
            "upload_time": "2022-07-13T08:24:29",
            "upload_time_iso_8601": "2022-07-13T08:24:29.704373Z",
            "url": "https://files.pythonhosted.org/packages/68/eb/e96c25f5accb24b151c5a559961f29af2ef089725b547efb185985c73e10/attr-0.3.2-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "c032c90f50d21029b4d2178ff2d9025f",
                "sha256": "1ceebca768181cdcce9827611b1d728e592be5d293911539ea3d0b0bfa1146f4"
            },
            "downloads": -1,
            "filename": "attr-0.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "c032c90f50d21029b4d2178ff2d9025f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 2649,
            "upload_time": "2022-07-13T08:24:30",
            "upload_time_iso_8601": "2022-07-13T08:24:30.926218Z",
            "url": "https://files.pythonhosted.org/packages/e4/d2/d0a5e36049ec6f72f4951b7f843b359d21e5a208b120618686187234dd1d/attr-0.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-07-13 08:24:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "denis-ryzhkov",
    "github_project": "attr",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "attr"
}
        
Elapsed time: 1.01753s