{ "info": { "author": "Sebastian Wiesendahl", "author_email": "sebastian@wiesendahl.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Internationalization", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Localization", "Topic :: Software Development :: Testing", "Topic :: System :: Benchmark", "Topic :: Utilities" ], "description": "tocolib\n=======\n\nA multipurpose utility library for Python 2 and 3.\n\nThe library namespace is ``tocoli``. For information on \navailable packages, modules and functionality see `Structure`_.\n\nHighlights\n----------\n\nSorting dictionaries\n>>>>>>>>>>>>>>>>>>>>\n\n Sort a 'list' of 'dict' by simply defining the `keys` you like to sort\n by in order from last to first.\n\n Example:\n\n >>> dicts = [{'firstname': 'Bob', 'lastname': 'Abel'},\n {'firstname': 'Alice', 'lastname': 'Bond'},\n {'firstname': 'Carol', 'lastname': 'Bond'},\n {'firstname': 'Bob', 'lastname': 'Bond'},\n {'firstname': 'Carol', 'lastname': 'Abel'},\n {'firstname': 'Alice', 'lastname': 'Abel'}]\n\n >>> from tocoli.sort import sort_dicts_by_value\n >>> sort_dicts_by_value(dicts, ['lastname', 'firstname'])\n [{'firstname': 'Alice', 'lastname': 'Abel'},\n {'firstname': 'Bob', 'lastname': 'Abel'},\n {'firstname': 'Carol', 'lastname': 'Abel'},\n {'firstname': 'Alice', 'lastname': 'Bond'},\n {'firstname': 'Bob', 'lastname': 'Bond'},\n {'firstname': 'Carol', 'lastname': 'Bond'}]\n\nA Domain Specific Language for intuitive function calls\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\n The ``dsl`` package provides a coherent style to access the `tocolib`\n modules and functions as module or static class functions.\n\n Example:\n\n >>> from tocoli.dsl import sort\n\n >>> sort.dicts.by.value(dicts, ['lastname', 'firstname'])\n [{'firstname': 'Alice', 'lastname': 'Abel'},\n {'firstname': 'Bob', 'lastname': 'Abel'},\n {'firstname': 'Carol', 'lastname': 'Abel'},\n {'firstname': 'Alice', 'lastname': 'Bond'},\n {'firstname': 'Bob', 'lastname': 'Bond'},\n {'firstname': 'Carol', 'lastname': 'Bond'}]\n\n >>> sort.dicts.by.similarity(dicts, 'Karol', ['firstname'])\n [{'firstname': 'Carol', 'lastname': 'Bond'},\n {'firstname': 'Carol', 'lastname': 'Abel'},\n {'firstname': 'Alice', 'lastname': 'Bond'},\n {'firstname': 'Alice', 'lastname': 'Abel'},\n {'firstname': 'Bob', 'lastname': 'Abel'},\n {'firstname': 'Bob', 'lastname': 'Bond'}]\n\nPowerful mapping\n>>>>>>>>>>>>>>>>\n\n Use recursive mapping to apply functions to nested data structures.\n\n Example:\n\n >>> from tocoli.dsl import map\n\n >>> def upper(item, parent):\n return item.upper()\n\n >>> map.recursive(dicts, upper)\n [{'firstname': 'BOB', 'lastname': 'ABEL'},\n {'firstname': 'ALICE', 'lastname': 'BOND'},\n {'firstname': 'CAROL', 'lastname': 'BOND'},\n {'firstname': 'BOB', 'lastname': 'BOND'},\n {'firstname': 'CAROL', 'lastname': 'ABEL'},\n {'firstname': 'ALICE', 'lastname': 'ABEL'}]\n\n >>> map_keys = (map.DEFAULT | map.DICT_KEY) ^ map.DICT_VALUE\n >>> map.recursive(dicts, upper, map_keys)\n [{'FIRSTNAME': 'Bob', 'LASTNAME': 'Abel'},\n {'FIRSTNAME': 'Alice', 'LASTNAME': 'Bond'},\n {'FIRSTNAME': 'Carol', 'LASTNAME': 'Bond'},\n {'FIRSTNAME': 'Bob', 'LASTNAME': 'Bond'},\n {'FIRSTNAME': 'Carol', 'LASTNAME': 'Abel'},\n {'FIRSTNAME': 'Alice', 'LASTNAME': 'Abel'}]\n\n\nWhat's New\n----------\n\n* Changed minimum requirement: passlib>=1.7.0\n* The former ``dsl`` module is now an own subpackage.\n* The `keys` parameter notation for sorting functions changed.\n* There are new `flags` paramter options for mapping functions.\n\nFor more detailed information on current changes check the `CHANGELOG.md `_\n\nStructure\n---------\n\nNamespace\n>>>>>>>>>\n\n``tocoli`` **- root**\n The tocolib wraps the ``six`` library (Python 2 and 3 compatibility utilities)\n at the root. Thus all ``six`` packages and modules are also available under the\n root namespace.\n\n\nSubpackages\n>>>>>>>>>>>\n\n``dsl`` **- a domain specific language for tocolib**\n Python, like it should be. The module contains a domain specific language\n for common functions like filtering, sorting, mapping and more. All\n functions have a consistent API and results.\n\n\nModules\n>>>>>>>\n\n``auth`` **- common authetication helpers**\n Its dangerous out there. This module is all about passwords, hashes, salts,\n tokens and api keys.\n\n``cmp`` **- compare utilities**\n For those who like to compare apples with pears. Make different data types\n comparable.\n\n``enc`` **- encoding functions**\n Encoding without pain. Provides universal encoding functions.\n\n``filter`` **- filter functions**\n The good ones go into the pot, the bad ones go into your crop. Advanced\n functions to filter dictionaries or lists of strings.\n\n``fn`` **- common lambda functions**\n To Be or not to Be: That is the question! Short value extractor functions\n and more.\n\n``join`` **- join/reduce/folding functions**\n Bring together what belongs together.\n\n``map`` **- mapping functions**\n It's still magic even if you know how it's done. Map data by applying any\n higher-order function to it.\n\n``ratio`` **- ratio functions**\n Comparisons make unhappy, but can be quite useful. Provides ratio\n functions for varios purposes.\n\n``regex`` **- regular expression utilities**\n Find what you are searching for. Generate common regular expressions.\n\n``sort`` **- sort functions**\n Chuck Norris is able to sort black pens by color. Sort data by value or keys.\n\n``spell`` **- spelling utilities**\n Life doesn't come with spell-check, but tocolib does.\n\n``test`` **- testing and benchmarking**\n Tests cant prove the absence of bugs. Thus test as good as you can.\n\n``type`` **- type conversion utilities**\n What doesn't fit is made to fit. Universal type transformations.\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/tocoli/tocolib", "keywords": "development utility library encoding sort filter testing", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "tocolib", "package_url": "https://pypi.org/project/tocolib/", "platform": "", "project_url": "https://pypi.org/project/tocolib/", "project_urls": { "Homepage": "https://github.com/tocoli/tocolib" }, "release_url": "https://pypi.org/project/tocolib/0.3.1/", "requires_dist": [ "six", "chardet", "python-levenshtein", "itsdangerous", "passlib (>=1.7.0)" ], "requires_python": "", "summary": "A utility library", "version": "0.3.1" }, "last_serial": 4651832, "releases": { "0.3.1": [ { "comment_text": "", "digests": { "md5": "e2f6be4617a3b0376e55a89138e96eca", "sha256": "7c64f65bc288beb189e77d70da0fac45f40a952f331e78a4fae95d612618a5f5" }, "downloads": -1, "filename": "tocolib-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e2f6be4617a3b0376e55a89138e96eca", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 24240, "upload_time": "2019-01-02T06:03:28", "url": "https://files.pythonhosted.org/packages/96/6f/edd9d19b53b878765689c80f95c0846698a39a02d03c560675f0796c499c/tocolib-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7badb655dd7dc9fac683a7ba8221617a", "sha256": "34eb29a6bfcd8e0f8f5eb5580cba7af44b5a809215fa24999aba08ee6606a3e4" }, "downloads": -1, "filename": "tocolib-0.3.1.tar.gz", "has_sig": false, "md5_digest": "7badb655dd7dc9fac683a7ba8221617a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30034, "upload_time": "2019-01-02T06:03:31", "url": "https://files.pythonhosted.org/packages/6d/6c/ef1166d0125d9d4f09dd0690bca6963f8e4214e7a30d95352233004c1e42/tocolib-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e2f6be4617a3b0376e55a89138e96eca", "sha256": "7c64f65bc288beb189e77d70da0fac45f40a952f331e78a4fae95d612618a5f5" }, "downloads": -1, "filename": "tocolib-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e2f6be4617a3b0376e55a89138e96eca", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 24240, "upload_time": "2019-01-02T06:03:28", "url": "https://files.pythonhosted.org/packages/96/6f/edd9d19b53b878765689c80f95c0846698a39a02d03c560675f0796c499c/tocolib-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7badb655dd7dc9fac683a7ba8221617a", "sha256": "34eb29a6bfcd8e0f8f5eb5580cba7af44b5a809215fa24999aba08ee6606a3e4" }, "downloads": -1, "filename": "tocolib-0.3.1.tar.gz", "has_sig": false, "md5_digest": "7badb655dd7dc9fac683a7ba8221617a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30034, "upload_time": "2019-01-02T06:03:31", "url": "https://files.pythonhosted.org/packages/6d/6c/ef1166d0125d9d4f09dd0690bca6963f8e4214e7a30d95352233004c1e42/tocolib-0.3.1.tar.gz" } ] }