Name | py-fast-trie JSON |
Version |
2.1.2
JSON |
| download |
home_page | |
Summary | Python library for tries with different grades of fastness. |
upload_time | 2023-08-30 16:43:53 |
maintainer | |
docs_url | None |
author | |
requires_python | ~=3.9 |
license | # The Prosperity Public License 3.0.0 Contributor: Jeremy Brown Source Code: https://github.com/mischif/py-fast-trie ## Purpose This license allows you to use and share this software for noncommercial purposes for free and to try this software for commercial purposes for thirty days. ## Agreement In order to receive this license, you have to agree to its rules. Those rules are both obligations under that agreement and conditions to your license. Don't do anything with this software that triggers a rule you can't or won't follow. ## Notices Make sure everyone who gets a copy of any part of this software from you, with or without changes, also gets the text of this license and the contributor and source code lines above. ## Commercial Trial Limit your use of this software for commercial purposes to a thirty-day trial period. If you use this software for work, your company gets one trial period for all personnel, not one trial per person. ## Contributions Back Developing feedback, changes, or additions that you contribute back to the contributor on the terms of a standardized public software license such as [the Blue Oak Model License 1.0.0](https://blueoakcouncil.org/license/1.0.0), [the Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0.html), [the MIT license](https://spdx.org/licenses/MIT.html), or [the two-clause BSD license](https://spdx.org/licenses/BSD-2-Clause.html) doesn't count as use for a commercial purpose. ## Personal Uses Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, doesn't count as use for a commercial purpose. ## Noncommercial Organizations Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution doesn't count as use for a commercial purpose regardless of the source of funding or obligations resulting from the funding. ## Defense Don't make any legal claim against anyone accusing this software, with or without changes, alone or with other technology, of infringing any patent. ## Copyright The contributor licenses you to do everything with this software that would otherwise infringe their copyright in it. ## Patent The contributor licenses you to do everything with this software that would otherwise infringe any patents they can license or become able to license. ## Reliability The contributor can't revoke this license. ## Excuse You're excused for unknowingly breaking [Notices](#notices) if you take all practical steps to comply within thirty days of learning you broke the rule. ## No Liability ***As far as the law allows, this software comes as is, without any warranty or condition, and the contributor won't be liable to anyone for any damages related to this software or this license, under any kind of legal claim.*** |
keywords |
x-fast
y-fast
trie
data structures
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
py-fast-trie
============
[](https://github.com/mischif/py-fast-trie/actions)
[](https://codecov.io/gh/mischif/py-fast-trie)
[](https://pypi.org/project/py-fast-trie/)
[](https://pypi.org/project/py-fast-trie/)
py-fast-trie is a package that contains pure-Python implementations of an [X-fast Trie](https://en.wikipedia.org/wiki/X-fast_trie) and a [Y-fast trie](https://en.wikipedia.org/wiki/Y-fast_trie), as described in the [foundational paper](https://web.archive.org/web/20230818235641/https://users.cs.utah.edu/~pandey/courses/cs6968/spring23/papers/yfast.pdf).
The most notable benefit of X-fast and Y-fast tries compared to more common data structures such as binary search trees is that searches are log-logarithmic in the cardinality of the universe as opposed to being logarithmic in the number of elements in the structure itself; For reference if you needed to store 2^20 items with a potential maximum value of 2^32 - 1, finding a particular item would take 20 operations in a red/black or AVL tree, but only 5 with an X-fast or Y-fast trie.
Usage
-----
The interfaces of the X-fast and Y-fast tries are identical, the Y-fast trie is used here as an example.
>>> from py_fast_trie import YFastTrie
>>> t = YFastTrie(max_length=32) # The library defaults to the machine's word size
>>> for i in range(10, 13):
... t += i # Value insertion/removal operations have intuitive
>>> t.min # shorthands
10
>>> t += b'\x0d' # The library can handle byte strings less than the
>>> t.max # max length by treating them as integers
13
>>> for val in t:
... print val
10
11
12
13
>>> t < 12 # Predecessor/successor queries have intuitive
11 # shorthands
>>> t > 0
10
t -= 13
>>> t > 12
>>>
Raw data
{
"_id": null,
"home_page": "",
"name": "py-fast-trie",
"maintainer": "",
"docs_url": null,
"requires_python": "~=3.9",
"maintainer_email": "",
"keywords": "x-fast,y-fast,trie,data structures",
"author": "",
"author_email": "Jeremy Brown <mischif@users.noreply.github.com>",
"download_url": "https://files.pythonhosted.org/packages/4d/69/3e9d86934ece2045653a76e54a3d1fbc9d7572679332ba57efc0024723ff/py-fast-trie-2.1.2.tar.gz",
"platform": null,
"description": "py-fast-trie\n============\n\n[](https://github.com/mischif/py-fast-trie/actions)\n[](https://codecov.io/gh/mischif/py-fast-trie)\n[](https://pypi.org/project/py-fast-trie/)\n[](https://pypi.org/project/py-fast-trie/)\n\npy-fast-trie is a package that contains pure-Python implementations of an [X-fast Trie](https://en.wikipedia.org/wiki/X-fast_trie) and a [Y-fast trie](https://en.wikipedia.org/wiki/Y-fast_trie), as described in the [foundational paper](https://web.archive.org/web/20230818235641/https://users.cs.utah.edu/~pandey/courses/cs6968/spring23/papers/yfast.pdf).\n\nThe most notable benefit of X-fast and Y-fast tries compared to more common data structures such as binary search trees is that searches are log-logarithmic in the cardinality of the universe as opposed to being logarithmic in the number of elements in the structure itself; For reference if you needed to store 2^20 items with a potential maximum value of 2^32 - 1, finding a particular item would take 20 operations in a red/black or AVL tree, but only 5 with an X-fast or Y-fast trie.\n\nUsage\n-----\n\nThe interfaces of the X-fast and Y-fast tries are identical, the Y-fast trie is used here as an example.\n\n\t>>> from py_fast_trie import YFastTrie\n\t>>> t = YFastTrie(max_length=32)\t\t# The library defaults to the machine's word size\n\t>>> for i in range(10, 13):\n\t... t += i\t\t\t\t\t# Value insertion/removal operations have intuitive\n\t>>> t.min\t\t\t\t\t# shorthands\n\t10\n\t>>> t += b'\\x0d'\t\t\t\t# The library can handle byte strings less than the\n\t>>> t.max\t\t\t\t\t# max length by treating them as integers\n\t13\n\t>>> for val in t:\n\t... print val\n\t10\n\t11\n\t12\n\t13\n\t>>> t < 12\t\t\t\t\t# Predecessor/successor queries have intuitive\n\t11\t\t\t\t\t\t# shorthands\n\t>>> t > 0\n\t10\n\tt -= 13\n\t>>> t > 12\n\t>>>\n",
"bugtrack_url": null,
"license": "# The Prosperity Public License 3.0.0 Contributor: Jeremy Brown Source Code: https://github.com/mischif/py-fast-trie ## Purpose This license allows you to use and share this software for noncommercial purposes for free and to try this software for commercial purposes for thirty days. ## Agreement In order to receive this license, you have to agree to its rules. Those rules are both obligations under that agreement and conditions to your license. Don't do anything with this software that triggers a rule you can't or won't follow. ## Notices Make sure everyone who gets a copy of any part of this software from you, with or without changes, also gets the text of this license and the contributor and source code lines above. ## Commercial Trial Limit your use of this software for commercial purposes to a thirty-day trial period. If you use this software for work, your company gets one trial period for all personnel, not one trial per person. ## Contributions Back Developing feedback, changes, or additions that you contribute back to the contributor on the terms of a standardized public software license such as [the Blue Oak Model License 1.0.0](https://blueoakcouncil.org/license/1.0.0), [the Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0.html), [the MIT license](https://spdx.org/licenses/MIT.html), or [the two-clause BSD license](https://spdx.org/licenses/BSD-2-Clause.html) doesn't count as use for a commercial purpose. ## Personal Uses Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, doesn't count as use for a commercial purpose. ## Noncommercial Organizations Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution doesn't count as use for a commercial purpose regardless of the source of funding or obligations resulting from the funding. ## Defense Don't make any legal claim against anyone accusing this software, with or without changes, alone or with other technology, of infringing any patent. ## Copyright The contributor licenses you to do everything with this software that would otherwise infringe their copyright in it. ## Patent The contributor licenses you to do everything with this software that would otherwise infringe any patents they can license or become able to license. ## Reliability The contributor can't revoke this license. ## Excuse You're excused for unknowingly breaking [Notices](#notices) if you take all practical steps to comply within thirty days of learning you broke the rule. ## No Liability ***As far as the law allows, this software comes as is, without any warranty or condition, and the contributor won't be liable to anyone for any damages related to this software or this license, under any kind of legal claim.*** ",
"summary": "Python library for tries with different grades of fastness.",
"version": "2.1.2",
"project_urls": {
"repository": "https://github.com/mischif/py-fast-trie"
},
"split_keywords": [
"x-fast",
"y-fast",
"trie",
"data structures"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d8fbb08e0b379896f7211a65b8e3f35f3952746709c627d989f1f8d132226fa6",
"md5": "633c053620508a7215009cbdc17a0bfb",
"sha256": "4a40c52908e9cf6b58a6cdb8a4b3cac0aadce8b58cd98c01198ca941a01c1a8d"
},
"downloads": -1,
"filename": "py_fast_trie-2.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "633c053620508a7215009cbdc17a0bfb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.9",
"size": 12374,
"upload_time": "2023-08-30T16:43:52",
"upload_time_iso_8601": "2023-08-30T16:43:52.273096Z",
"url": "https://files.pythonhosted.org/packages/d8/fb/b08e0b379896f7211a65b8e3f35f3952746709c627d989f1f8d132226fa6/py_fast_trie-2.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4d693e9d86934ece2045653a76e54a3d1fbc9d7572679332ba57efc0024723ff",
"md5": "0e44afd26c2dcf61650d4f0f174bd294",
"sha256": "0fd28b709af8b322b34f747906389ae1c3da09c4b357d5ba98d70dd3bfdba03d"
},
"downloads": -1,
"filename": "py-fast-trie-2.1.2.tar.gz",
"has_sig": false,
"md5_digest": "0e44afd26c2dcf61650d4f0f174bd294",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.9",
"size": 17863,
"upload_time": "2023-08-30T16:43:53",
"upload_time_iso_8601": "2023-08-30T16:43:53.321511Z",
"url": "https://files.pythonhosted.org/packages/4d/69/3e9d86934ece2045653a76e54a3d1fbc9d7572679332ba57efc0024723ff/py-fast-trie-2.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-30 16:43:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mischif",
"github_project": "py-fast-trie",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "py-fast-trie"
}