{ "info": { "author": "Justin Barber", "author_email": "barber.justin@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Shackles\n========\n\n.. image:: https://secure.travis-ci.org/barberj/shackles.png?branch=develop\n\nAccess and inspect attributes shackled to an object.\nShackles is MIT Licensed.\n\n\nInstallation\n------------\n\nTo install configit, simply: ::\n\n $ pip install shackles\n\n\nAPI Documentation\n-----------------\n\nshackles.broken(obj, chain)\n Return name of first missing named attribute of object.\n\n If chain is not broken (all attributes are represented in chain)\n nothing is returned.\n\n::\n\n # obj.a.b.e\n assert shackles.broken(obj, 'a.b.c') == 'c'\n\nshackles.get(obj, chain[, default])\n Return value of final named attribute in chain of object.\n\n If a named attribute does not exist,\n default is returned if provided, otherwise *AttributeError* is raised.\n\n::\n\n # obj.a.b\n assert shackles.get(obj, 'a.b.c', 5) == 5\n\n # obj.a.b.c = 6\n assert shackles.get(obj, 'a.b.c', 5) == 6\n\nshackles.has(obj, chain)\n Return *True* if the chain of attributes exists on the object, *False* if not.\n\n::\n\n # obj.a.b.c\n assert shackles.has(obj, 'a.b.c']) == True\n\nshackles.walk(obj, chain)\n Generate the values of the attributes in the chain by walking the named attributes in the chain from the object.\n\n If a named attribute does not exist,\n default is returned if provided, otherwise *AttributeError* is raised.\n\n::\n\n # a = obj; b = obj; c = obj\n # a.name = 'a'; b.name = 'b'; c.name = 'c'\n # a.b = b; b.c = c\n assert next(shackles.walk(a, 'b.c')).name == 'b'\n\n**For further examples refer to included tests.**\n\n\nContribute\n----------\n\n#. Fork `the repository `_ on Github to start making your changes to the **develop** branch (or branch off of it).\n#. Install to your env or venv by running: ::\n\n $ python setup.py develop\n\n#. Write a test which shows that the bug was fixed or that the feature works as expected.\n#. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to `AUTHORS `_.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/barberj/shackles", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "shackles", "package_url": "https://pypi.org/project/shackles/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/shackles/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/barberj/shackles" }, "release_url": "https://pypi.org/project/shackles/1.0/", "requires_dist": null, "requires_python": null, "summary": "Recursive attribute tools.", "version": "1.0" }, "last_serial": 799475, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "2e68e91ce9ec97284894aecad34d0c38", "sha256": "063afc05bc0c792769544c090575c1644eef1b29cddce3df6dec91252ec77220" }, "downloads": -1, "filename": "shackles-0.0.2.tar.gz", "has_sig": false, "md5_digest": "2e68e91ce9ec97284894aecad34d0c38", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1555, "upload_time": "2012-07-23T04:11:09", "url": "https://files.pythonhosted.org/packages/38/af/eb9247ba7c139fe936f898c28b2df4d7c294fe4ee9a896c8de3bb0af6ff4/shackles-0.0.2.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "d60ff6c7ba104bac88e9c54967389c35", "sha256": "f54566ce5229e0714ee874bd27081b19e695c3917c8a957de798a80bba49b371" }, "downloads": -1, "filename": "shackles-0.1.1.tar.gz", "has_sig": false, "md5_digest": "d60ff6c7ba104bac88e9c54967389c35", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3471, "upload_time": "2012-09-27T19:59:41", "url": "https://files.pythonhosted.org/packages/e8/f1/9e2d3b7e1c4444205ef853e0cf46202e769ec1b4282945cf9b823645f7c6/shackles-0.1.1.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "0ef76f076abd92a26c8c07cfebbe662f", "sha256": "485890b2527aae93a9336a2f3293d38ea82dff95e5953a9e9db6de28e6ae6bb4" }, "downloads": -1, "filename": "shackles-1.0.tar.gz", "has_sig": false, "md5_digest": "0ef76f076abd92a26c8c07cfebbe662f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3358, "upload_time": "2012-09-27T19:30:51", "url": "https://files.pythonhosted.org/packages/e7/68/b93264638e501d16f00da13bbdc0c811c5f151d96afaadf2c7920446ac34/shackles-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0ef76f076abd92a26c8c07cfebbe662f", "sha256": "485890b2527aae93a9336a2f3293d38ea82dff95e5953a9e9db6de28e6ae6bb4" }, "downloads": -1, "filename": "shackles-1.0.tar.gz", "has_sig": false, "md5_digest": "0ef76f076abd92a26c8c07cfebbe662f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3358, "upload_time": "2012-09-27T19:30:51", "url": "https://files.pythonhosted.org/packages/e7/68/b93264638e501d16f00da13bbdc0c811c5f151d96afaadf2c7920446ac34/shackles-1.0.tar.gz" } ] }