{ "info": { "author": "Malthe Borch", "author_email": "mborch@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: C", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "SkipDict\n========\n\nA skip dict is a Python dictionary which is permanently sorted by\nvalue. This package provides a fast, idiomatic implementation written\nin C with an extensive test suite.\n\nThe data structure uses a `skip list\n`_ internally.\n\nAn example use is a leaderboard where the skip dict provides\nlogarithmic access to the score and ranking of each user, as well as\nefficient iteration in either direction from any node.\n\nCompatible with Python 2.7+ and Python 3.3+.\n\n\nUsage\n-----\n\nThe skip dict works just like a normal dictionary except it maps only\nto floating point values::\n\n from skipdict import SkipDict\n\n skipdict = SkipDict(maxlevel=4)\n\n skipdict['foo'] = 1.0\n skipdict['bar'] = 2.0\n\nThe ``SkipDict`` optionally takes a dictionary or a sequence of\n``(key, value)`` pairs::\n\n skipdict = SkipDict({'foo': 1.0, 'bar': 2.0})\n skipdict = SkipDict(('foo', 1.0), ('bar', 1.0), ('bar', 1.0))\n\nNote that duplicates are automatically aggregated to a sum. To\nillustrate this, we can count the occurrences of letters in a text::\n\n skipdict = SkipDict(\n (char, 1) for char in\n \"Everything popular is wrong. - Oscar Wilde\"\n )\n\n # The most frequent letter is a space.\n skipdict.keys()[-1] == \" \"\n\nThe ``skipdict`` is sorted by value which means that iteration and\nstandard mapping protocol methods such as ``keys()``, ``values()`` and\n``items()`` return items in sorted order.\n\nEach of these methods have been extended with optional range arguments\n``min`` and ``max`` which limit iteration based on value. In addition,\nthe iterator objects support the item and slice protocols:\n\n>>> skipdict.keys(min=2.0)[0]\n'bar'\n>>> skipdict.keys(max=2.0)[1:]\n['bar']\n\nNote that the methods always return an iterator. Use ``list`` to\nexpand to a sequence:\n\n>>> iterator = skipdict.keys()\n>>> list(iterator)\n['bar']\n\nThe ``index(value)`` method returns the first key that has exactly the\nrequired value. If the value is not found then a ``KeyError``\nexception is raised.\n\n>>> skipdict.index(2.0)\n'bar'\n\n\nAlternatives\n------------\n\nFrancesco Romani wrote `pyskiplist\n`_ which also provides an\nimplementation of the skip list datastructure for CPython written\nin C.\n\nPaul Colomiets wrote `sortedsets\n`_ which is an implementation\nin pure Python. The randomized test cases were adapted from this\npackage.\n\n\nLicense\n-------\n\nCopyright (c) 204 Malthe Borch \n\nThis software is provided \"as-is\" under the BSD License.\n\n\nChanges\n-------\n\n1.0 (2014-09-26)\n----------------\n\n- Initial public release.", "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/malthe/skipdict", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "skipdict", "package_url": "https://pypi.org/project/skipdict/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/skipdict/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/malthe/skipdict" }, "release_url": "https://pypi.org/project/skipdict/1.0/", "requires_dist": null, "requires_python": null, "summary": "Python dictionary object permanently sorted by value.", "version": "1.0" }, "last_serial": 1238241, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "3375301e88d2c42e30a32dbe89e9e270", "sha256": "82f90eae2919b305628b6a607b36c7458aef5e3210d1bf836f9bca0eec63d016" }, "downloads": -1, "filename": "skipdict-1.0.tar.gz", "has_sig": false, "md5_digest": "3375301e88d2c42e30a32dbe89e9e270", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16610, "upload_time": "2014-09-25T22:46:13", "url": "https://files.pythonhosted.org/packages/c4/76/dc38b95a8fc89f4d8a8fd06e73f347ef2247b07cbcd3a0395248f5b9bf59/skipdict-1.0.tar.gz" } ], "1.0-dev": [] }, "urls": [ { "comment_text": "", "digests": { "md5": "3375301e88d2c42e30a32dbe89e9e270", "sha256": "82f90eae2919b305628b6a607b36c7458aef5e3210d1bf836f9bca0eec63d016" }, "downloads": -1, "filename": "skipdict-1.0.tar.gz", "has_sig": false, "md5_digest": "3375301e88d2c42e30a32dbe89e9e270", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16610, "upload_time": "2014-09-25T22:46:13", "url": "https://files.pythonhosted.org/packages/c4/76/dc38b95a8fc89f4d8a8fd06e73f347ef2247b07cbcd3a0395248f5b9bf59/skipdict-1.0.tar.gz" } ] }