{ "info": { "author": "Ilian Stefkov Iliev", "author_email": "ilian@ilian.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "===================\nShelves and Buckets\n===================\n\n\n.. image:: https://img.shields.io/pypi/v/shelves_and_buckets.svg\n :target: https://pypi.python.org/pypi/shelves_and_buckets\n\n.. image:: https://img.shields.io/travis/lifesum/shelves_and_buckets.svg\n :target: https://travis-ci.org/lifesum/shelves_and_buckets\n\n.. image:: https://readthedocs.org/projects/shelves-and-buckets/badge/?version=latest\n :target: https://shelves-and-buckets.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://pyup.io/repos/github/lifesum/shelves_and_buckets/shield.svg\n :target: https://pyup.io/repos/github/lifesum/shelves_and_buckets/\n :alt: Updates\n\n\nShelves and buckets is a small package for easier work with grouped data or data ranges. It originates from the need to easily find data in multidimensional space using intervals. Lets look at the following examples:\n\n* Free software: MIT license\n* Documentation: https://shelves-and-buckets.readthedocs.io.\n\n\nFeatures\n--------\n\nInterval shelves are using the intervals_ package\n\n.. _intervals: https://pypi.python.org/pypi/intervals\n\n - IntIntervalShelf - interval boundaries are integers\n - FloatIntervalShelf - interval boundaries are floats\n - NamedShelf - takes a dictionary as input and behaves similarly but could be combined with other shelves\n\n\nExamples\n--------\n\nConsider the following data for physical state based on number of pushups a person can make\n\n +------------+------+-----------+-----------+\n + Pushup + <20 | 21 - 40 | 41+ +\n +============+======+===========+===========+\n + Grade + Poor | Average | Excellent +\n +------------+------+-----------+-----------+\n\n\nHow to find in which group the user belongs based on their score::\n\n >>> from shelves_and_buckets import IntIntervalShelf\n >>> shelf = IntIntervalShelf([\n ('(, 20]', 'poor'),\n ('[21, 40]', 'average'),\n ('[41, )', 'excellent'),\n ])\n >>> shelf.get(5)\n 'poor'\n >>> shelf.get(25)\n 'average\n\nOk, let's take a look at a bit more complicated example, what if we have another dimension e.g. the age of the person.\n\n +-------------+-----------+---------------+---------+\n + Age / Grade + excellent + above average + average +\n +=============+===========+===============+=========+\n + 20-29 + > 54 + 45-54 + 35-44 +\n +-------------+-----------+---------------+---------+\n + 30-39 + > 44 + 35-44 + 24-34 +\n +-------------+-----------+---------------+---------+\n + 40-49 + > 39 + 30-39 + 20-29 +\n +-------------+-----------+---------------+---------+\n\nExample::\n\n male_20_29_shelf = IntIntervalShelf([\n ('[35, 44]', 'average'),\n ('[45, 54]', 'above average'),\n ('(54, )', 'excellent'),\n ])\n\n male_30_39_shelf = IntIntervalShelf([\n ('[24, 34]', 'average'),\n ('[35, 44]', 'above average'),\n ('(44, )', 'excellent'),\n ])\n\n age_shelf = IntIntervalShelf([\n ('[20, 29]', male_20_29_shelf),\n ('[30, 39]', male_30_39_shelf),\n ])\n\n >>> age_shelf.get_multi(24, 42) # value are passed from the outer shelves in, in this case -> age, pushups\n 'average'\n\n\nShelves also support usage with indexing for adding and getting buckets::\n\n shelf = IntIntervalShelf()\n shelf[[0, 10]] = 'Bucket A'\n shelf[[11, 20]] = 'Bucket B'\n >>> shelf[5]\n 'Bucket A'\n\n\nTODOs\n-----\n\n - Add check for intervals overlap\n - Add option to avoid holes between intervals\n - Add option to pass directly Interval object when creating bucket\n - Consider using bisect for faster search in intervals http://www.ilian.io/working-with-intervals-in-python/\n\nCredits\n---------\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n\nThis package uses Intervals_ by `Konsta Vesterinen`_\n\n.. _`Konsta Vesterinen`: https://github.com/kvesteri\n\n\n=======\nHistory\n=======\n\n0.1.0.beta (2017-10-26)\n------------------\n\n* First release on PyPI.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lifesum/shelves_and_buckets", "keywords": "shelves_and_buckets", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "shelves_and_buckets", "package_url": "https://pypi.org/project/shelves_and_buckets/", "platform": "", "project_url": "https://pypi.org/project/shelves_and_buckets/", "project_urls": { "Homepage": "https://github.com/lifesum/shelves_and_buckets" }, "release_url": "https://pypi.org/project/shelves_and_buckets/0.1.4/", "requires_dist": null, "requires_python": "", "summary": "Shelves and buckets for easier work with grouped data", "version": "0.1.4" }, "last_serial": 3397064, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "2b5c20f6c83c79103da803b6aab83c7e", "sha256": "ee8c04c3e03b37cd4f1dc4ce952b511c8b17216cbfb3481242c1c61b7f273be6" }, "downloads": -1, "filename": "shelves_and_buckets-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2b5c20f6c83c79103da803b6aab83c7e", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 6682, "upload_time": "2017-12-04T14:55:04", "url": "https://files.pythonhosted.org/packages/56/e7/f9907166b52f60f85ac6544773e808c7033c41850a55a160b1b2b1360602/shelves_and_buckets-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7b4645fa95e256e9d4d622ce26fd47b6", "sha256": "198cb854a14aef47ec555adc827c1709af0824ec203a88d9dbc647f4db96f8c6" }, "downloads": -1, "filename": "shelves_and_buckets-0.1.2.tar.gz", "has_sig": false, "md5_digest": "7b4645fa95e256e9d4d622ce26fd47b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22014, "upload_time": "2017-12-04T14:55:36", "url": "https://files.pythonhosted.org/packages/c0/61/506ce45ba72c4fe610a0dda113d7fe32f74eae73191f315cd8f4d1125337/shelves_and_buckets-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "448db4cffd92723601624dc18123cbfb", "sha256": "10a63826da4b3cdd60a2a8bbd52b8f0a569b33f142621b41501536c6b8edec63" }, "downloads": -1, "filename": "shelves_and_buckets-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "448db4cffd92723601624dc18123cbfb", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 6733, "upload_time": "2017-12-05T17:02:12", "url": "https://files.pythonhosted.org/packages/7b/c9/3766eb7843aacda701896e47e50accfa690bc39080e7ee8bf42c8b3eebb5/shelves_and_buckets-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "97f139e4144a2c86b26d4452cfb62fc3", "sha256": "592c3a603871a2cf241e11312ec95887f4abfc1f5984ac429c53a8c09dd6d193" }, "downloads": -1, "filename": "shelves_and_buckets-0.1.3.tar.gz", "has_sig": false, "md5_digest": "97f139e4144a2c86b26d4452cfb62fc3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22091, "upload_time": "2017-12-05T17:02:25", "url": "https://files.pythonhosted.org/packages/39/34/e758584dbdc794edb27a56ccb71422934524b55916c5e18a24870128c891/shelves_and_buckets-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "c842620a6e12e457b288d63c497c2654", "sha256": "092248eec02fc6eb51e1976ec18edc91f9f5d8e1cae31649fe1a8a41efa7389c" }, "downloads": -1, "filename": "shelves_and_buckets-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c842620a6e12e457b288d63c497c2654", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 6715, "upload_time": "2017-12-07T08:52:18", "url": "https://files.pythonhosted.org/packages/bf/29/3b0659b98d92566a9a060519aa4cf33f0cbc217dd06cd62e7b1f174ffee2/shelves_and_buckets-0.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "48b3b4a4417c81b50bfe869fb3a310bc", "sha256": "81e9b60245cd6be4f35fc63f8d4ed201842042dc28400877d166bf6cf97e6fee" }, "downloads": -1, "filename": "shelves_and_buckets-0.1.4.tar.gz", "has_sig": false, "md5_digest": "48b3b4a4417c81b50bfe869fb3a310bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22099, "upload_time": "2017-12-07T08:52:34", "url": "https://files.pythonhosted.org/packages/f9/4a/3955d5b7fda018367856db44393724f54a8ab8aaa07d94d4a455928553d1/shelves_and_buckets-0.1.4.tar.gz" } ], "0.1b0": [ { "comment_text": "", "digests": { "md5": "6e26f278bf76fef3fa780333e2271f4b", "sha256": "3b3cafc5e22180fc03083b04694cc391097cd0a57828fe85f5d3017722cb9173" }, "downloads": -1, "filename": "shelves_and_buckets-0.1b0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6e26f278bf76fef3fa780333e2271f4b", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 6441, "upload_time": "2017-11-23T14:46:09", "url": "https://files.pythonhosted.org/packages/67/bf/15ff6fac0323cb2dbd791d1aba638edbac7400eb94cfcc3f8561b28250a8/shelves_and_buckets-0.1b0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0fd4baa5a7b8d1cfa70e5bace569c24b", "sha256": "2f23d22bab98368f6934027910c690fb0b7d9ff08dd5c8feea2e473305a5b890" }, "downloads": -1, "filename": "shelves_and_buckets-0.1b0.tar.gz", "has_sig": false, "md5_digest": "0fd4baa5a7b8d1cfa70e5bace569c24b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21799, "upload_time": "2017-11-23T14:45:47", "url": "https://files.pythonhosted.org/packages/33/0e/75d59c9857a33e06415875df6acf621ec0f66fc3372eae5726d93b677135/shelves_and_buckets-0.1b0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c842620a6e12e457b288d63c497c2654", "sha256": "092248eec02fc6eb51e1976ec18edc91f9f5d8e1cae31649fe1a8a41efa7389c" }, "downloads": -1, "filename": "shelves_and_buckets-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c842620a6e12e457b288d63c497c2654", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 6715, "upload_time": "2017-12-07T08:52:18", "url": "https://files.pythonhosted.org/packages/bf/29/3b0659b98d92566a9a060519aa4cf33f0cbc217dd06cd62e7b1f174ffee2/shelves_and_buckets-0.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "48b3b4a4417c81b50bfe869fb3a310bc", "sha256": "81e9b60245cd6be4f35fc63f8d4ed201842042dc28400877d166bf6cf97e6fee" }, "downloads": -1, "filename": "shelves_and_buckets-0.1.4.tar.gz", "has_sig": false, "md5_digest": "48b3b4a4417c81b50bfe869fb3a310bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22099, "upload_time": "2017-12-07T08:52:34", "url": "https://files.pythonhosted.org/packages/f9/4a/3955d5b7fda018367856db44393724f54a8ab8aaa07d94d4a455928553d1/shelves_and_buckets-0.1.4.tar.gz" } ] }