{ "info": { "author": "Carl-Fredrik Arvidson", "author_email": "carl-fredrik@arvidson.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "===========\nUnderstreck\n===========\n\n\n.. image:: https://img.shields.io/pypi/v/understreck.svg\n :target: https://pypi.python.org/pypi/understreck\n\n.. image:: https://travis-ci.com/cfarvidson/understreck.svg?branch=master\n :target: https://travis-ci.com/cfarvidson/understreck\n\n.. image:: https://readthedocs.org/projects/understreck/badge/?version=latest\n :target: https://understreck.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/ambv/black\n :alt: Code style: black\n\nA collection of nice utility functions for python\n\n\n* Free software: GNU General Public License v3\n* Documentation: https://understreck.readthedocs.io.\n\n\nFeatures\n--------\n\n* Perform a safe get on a nested dictionary with the nested_get function\n* Split a list into chunks\n\nNested Get example::\n\n import understreck as _\n\n test_dictionary = {\n \"the_top_level\": {\n \"second_level\": {\"third_level\": \"it works\", \"third_level_sibling\": False}\n }\n }\n\n # Using dot delimited strings\n result = _.get(test_dictionary, \"the_top_level.second_level.third_level\") # result = \"it works\"\n result = _.get(test_dictionary, \"the_top_level.second_level.DOES_NOT_EXIST\") # result = None\n\n # Using a list or tuple\n result = _.get(test_dictionary, [\"the_top_level\", \"second_level\", \"third_level\"]) # result = \"it works\"\n result = _.get(test_dictionary, [\"the_top_level\", \"second_level\", \"DOES_NOT_EXIST\"]) # result = None\n\nChunks example::\n\n import understreck as _\n\n to_chunk = [\"one\", \"two\", \"three\", \"four\", \"five\"]\n result = _.chunks.split(to_chunk, 2) # result == [[\"one\", \"two\", \"three\"], [\"four\", \"five\"]]\n\nFilter example::\n\n import understreck as _\n\n users = [\n {\"user\": \"barney\", \"age\": 36, \"active\": True},\n {\"user\": \"fred\", \"age\": 40, \"active\": False},\n ]\n\n # Using a lambda function\n result = _.filter(users, lambda x: not x.get(\"active\")) # result == [{\"user\": \"fred\", \"age\": 40, \"active\": False}]\n\n # Using partial dictionary\n result = _.filter(users, {\"age\": 36, \"active\": True}) # result == [{\"user\": \"barney\", \"age\": 36, \"active\": True}]\n\n # Using a list with a property name and value\n result = _.filter(users, [\"active\", False]) # result == [{\"user\": \"fred\", \"age\": 40, \"active\": False}]\n\n # Using a list with a property name. The value must be truthy.\n result = _.filter(users, [\"active\"]) # result == [{\"user\": \"barney\", \"age\": 36, \"active\": True}]\n\nStrip indents example::\n\n import understreck as _\n\n def some_function():\n to_strip = \"\"\"This is a\n multi-line\n string\"\"\"\n\n _.strip(to_strip) # \"This is a\\nmulti-line\\nstring\"\n\nCredits\n-------\n\nI have to credit the Lodash_ project for inspiration!\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Lodash: https://lodash.com\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n\n\n=======\nHistory\n=======\n\nUnreleased\n----------\n\n0.5.0 (2019-05-03)\n------------------\n* Updates dev dependencies\n* Moves to the new repository\n\n0.4.0 (2019-05-03)\n------------------\n* Adds Understreck.strip that strips indents\n\n0.3.0 (2019-05-03)\n------------------\n* Adds Understreck.filter with inspired by https://lodash.com/docs/4.17.11#filter\n* Updated the travis button URL\n* Replaced nested_get with get in the README. (nested_get still works)\n* Black formatting\n\n0.2.1 (2018-12-10)\n------------------\n* Add Understreck.chunks\n\n0.2.0 (2018-11-12)\n------------------\n* Add get as an alias for nested get\n\n0.1.1 (2018-11-02)\n------------------\n* Update the readme\n\n0.1.0 (2018-11-02)\n------------------\n\n* First release on PyPI.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cfarvidson/understreck", "keywords": "understreck", "license": "GNU General Public License v3", "maintainer": "", "maintainer_email": "", "name": "understreck", "package_url": "https://pypi.org/project/understreck/", "platform": "", "project_url": "https://pypi.org/project/understreck/", "project_urls": { "Homepage": "https://github.com/cfarvidson/understreck" }, "release_url": "https://pypi.org/project/understreck/0.5.0/", "requires_dist": null, "requires_python": "", "summary": "A collection of nice utility functions for python", "version": "0.5.0" }, "last_serial": 5509209, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "771099cb13f78e51c8190818c5979574", "sha256": "0da716b1770e7ad208f25fd5b39bef959dd57c000b29cf1c9bfcfbce85f6e129" }, "downloads": -1, "filename": "understreck-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "771099cb13f78e51c8190818c5979574", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4111, "upload_time": "2018-11-02T14:38:51", "url": "https://files.pythonhosted.org/packages/15/27/12fcc18114dc633c9bddda7bcf9f0e7b74ac89ac26b977b7530e8f8fdb4f/understreck-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ded027ed9a7debff09f63534d6208b14", "sha256": "1dd00a1942f107486026f06c245b4ab459f975b6369e18bd7d3d414fa2e116d0" }, "downloads": -1, "filename": "understreck-0.1.0.tar.gz", "has_sig": false, "md5_digest": "ded027ed9a7debff09f63534d6208b14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9023, "upload_time": "2018-11-02T14:38:52", "url": "https://files.pythonhosted.org/packages/59/77/d391a620bd7c9bcf0a9684d9cd5e0babc6175f0f0035a13ba4e084568636/understreck-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "2653d2d27ccb6c18be09f200b5a405ea", "sha256": "e4144cf2ee19a2b3bf4d9ef0579eec23d045f23481163b175b368c48ac172ccd" }, "downloads": -1, "filename": "understreck-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2653d2d27ccb6c18be09f200b5a405ea", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4377, "upload_time": "2018-11-02T14:54:59", "url": "https://files.pythonhosted.org/packages/53/e6/74a1c97234bb2db89a6e0a0f5b7aaaf1c1a5be0179a8f03d4a4238d6ade4/understreck-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "600251118c15e9434f7ccfcdda44362d", "sha256": "4aa1eae4ccbb7d62c77c8fc9a2a7432fb6ccafd03c8b5a9d5ba2c9d4936014e3" }, "downloads": -1, "filename": "understreck-0.1.1.tar.gz", "has_sig": false, "md5_digest": "600251118c15e9434f7ccfcdda44362d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9127, "upload_time": "2018-11-02T14:55:00", "url": "https://files.pythonhosted.org/packages/93/3b/1a441c91b7534155e0b4fcd2b2d454b7cc80217938e800feded9e6425898/understreck-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "fdd0c0c983cccd3380dbad59a76d3d9a", "sha256": "c574feb20fae7a413f4c3eef1e2fa30e1f2056a90baee8bea36aacd6f96f2023" }, "downloads": -1, "filename": "understreck-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "fdd0c0c983cccd3380dbad59a76d3d9a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4415, "upload_time": "2018-11-12T14:56:15", "url": "https://files.pythonhosted.org/packages/d7/af/7affdc14ec00a017f40f058655bca8a5cbb1cbc7bbf8ff9bd2fdca73c850/understreck-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e15e4e612f4dfd645b8ef9e8b593c80b", "sha256": "8956fa3ca75b0725be3c2469c38f5ed9414d6f8ad63a4f07860f93eda0be1f08" }, "downloads": -1, "filename": "understreck-0.2.0.tar.gz", "has_sig": false, "md5_digest": "e15e4e612f4dfd645b8ef9e8b593c80b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9180, "upload_time": "2018-11-12T14:56:17", "url": "https://files.pythonhosted.org/packages/78/24/e1cc66b2d363f1233a6921964024be4210f5e6dfa24e3e74c666ac258b5c/understreck-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "9f72b12e960097b0fd0d4c530c3cfa9b", "sha256": "f460821ed13682f09238f48c104a18caf746ae8d1f103a23e0b59a37e79c1640" }, "downloads": -1, "filename": "understreck-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9f72b12e960097b0fd0d4c530c3cfa9b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5029, "upload_time": "2018-12-11T12:13:08", "url": "https://files.pythonhosted.org/packages/24/16/d0375c2ac2d5d4eef6bd7b18fab8bce0cb84915b4cdcad238f492cd990dc/understreck-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2d3f6b2c43e12cc4e2bacf4af28bf7d6", "sha256": "3d6395a9e4459013c1aa985adcae1f50c8a9a00406e0a65e32ffe880510f2d58" }, "downloads": -1, "filename": "understreck-0.2.1.tar.gz", "has_sig": false, "md5_digest": "2d3f6b2c43e12cc4e2bacf4af28bf7d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9790, "upload_time": "2018-12-11T12:13:10", "url": "https://files.pythonhosted.org/packages/c6/cb/ec77a61e67e176d85a58f66b30249ef619a3006032331de9757d77e072dd/understreck-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "787769f0f8c41bcbbc436cb70d4a4d11", "sha256": "89f8923468fa021baa254c8e2cefa92aa4ce9b2e0d6e692d6987329d4dd428cd" }, "downloads": -1, "filename": "understreck-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "787769f0f8c41bcbbc436cb70d4a4d11", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6161, "upload_time": "2019-05-03T11:20:42", "url": "https://files.pythonhosted.org/packages/ac/e8/19cc9c9a59608367871c2209fa4158223016ece81b3a868f99ff66eb228b/understreck-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8af46733307803e8eda6a452105d5675", "sha256": "526e35f35775b8bd3ef328ccd6f15b05a4f0eb52c46379713c446123d00707f3" }, "downloads": -1, "filename": "understreck-0.3.0.tar.gz", "has_sig": false, "md5_digest": "8af46733307803e8eda6a452105d5675", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22199, "upload_time": "2019-05-03T11:20:44", "url": "https://files.pythonhosted.org/packages/5a/1f/2a5a841e002af2eafed1b5a8cb92f7abce237ddb589af254011293ca9d07/understreck-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "678d2471b113e9ba0cdd3479e1ee6fc6", "sha256": "1a97724dfd94fcc714972221c6e3a36942f35ef62e328957a403b8a103f122e8" }, "downloads": -1, "filename": "understreck-0.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "678d2471b113e9ba0cdd3479e1ee6fc6", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6628, "upload_time": "2019-05-03T11:47:31", "url": "https://files.pythonhosted.org/packages/50/65/90275addaae1270a1a304a9654462f543295d02b66ab13c5d630eb58cdf8/understreck-0.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b3122c37b67f72b1cd07752cc40e3825", "sha256": "18a22917156cc3fc71892928c5c2416fbf2673a4565c5029b3b9887cc6a0a6ad" }, "downloads": -1, "filename": "understreck-0.4.0.tar.gz", "has_sig": false, "md5_digest": "b3122c37b67f72b1cd07752cc40e3825", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22591, "upload_time": "2019-05-03T11:47:32", "url": "https://files.pythonhosted.org/packages/71/61/556b756a5020c88e024750776a358c05c98f306ae260a10265a84fe5c5a5/understreck-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "23eac81bec88285131ff05f5f1be94cf", "sha256": "6318033fd0ddf11aa9999b9408906d317df3ca1e04cc48a32b108a7472a35c38" }, "downloads": -1, "filename": "understreck-0.5.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "23eac81bec88285131ff05f5f1be94cf", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6663, "upload_time": "2019-07-09T21:35:02", "url": "https://files.pythonhosted.org/packages/db/0c/3c8546711759fd24a3af9193ad8e4cf20ba4099d5371b2a9a3e3733e0913/understreck-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0a4481cbb6af944b88b5067661e5214a", "sha256": "04fa20b256c5a9eeb215c014d47073b576264e1d36309921d5e4a5970d1082d7" }, "downloads": -1, "filename": "understreck-0.5.0.tar.gz", "has_sig": false, "md5_digest": "0a4481cbb6af944b88b5067661e5214a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22883, "upload_time": "2019-07-09T21:35:04", "url": "https://files.pythonhosted.org/packages/1f/be/f7449320a7b1dbe1d03bdf830371b88520affb3e42424bf4271c1e0bf05b/understreck-0.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "23eac81bec88285131ff05f5f1be94cf", "sha256": "6318033fd0ddf11aa9999b9408906d317df3ca1e04cc48a32b108a7472a35c38" }, "downloads": -1, "filename": "understreck-0.5.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "23eac81bec88285131ff05f5f1be94cf", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6663, "upload_time": "2019-07-09T21:35:02", "url": "https://files.pythonhosted.org/packages/db/0c/3c8546711759fd24a3af9193ad8e4cf20ba4099d5371b2a9a3e3733e0913/understreck-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0a4481cbb6af944b88b5067661e5214a", "sha256": "04fa20b256c5a9eeb215c014d47073b576264e1d36309921d5e4a5970d1082d7" }, "downloads": -1, "filename": "understreck-0.5.0.tar.gz", "has_sig": false, "md5_digest": "0a4481cbb6af944b88b5067661e5214a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22883, "upload_time": "2019-07-09T21:35:04", "url": "https://files.pythonhosted.org/packages/1f/be/f7449320a7b1dbe1d03bdf830371b88520affb3e42424bf4271c1e0bf05b/understreck-0.5.0.tar.gz" } ] }