Utilities for navigating flat trees
Project description
flat-tree
Utilities for navigating flat trees
Flat Trees are the core data structure that power Hypercore feeds. They allow us to deterministically represent a tree structure as a vector. This is particularly useful because vectors map elegantly to disk and memory. Because Flat Trees are deterministic and pre-computed, there is no overhead to using them. In effect this means that Flat Trees are a specific way of indexing into a vector more than they are their own data structure. This makes them uniquely efficient and convenient to implement in a wide range of languages.
Install
$ pip install flat-tree
Example
from flat_tree.accessor import FlatTreeIterator
tree_iter = FlatTreeIterator()
assert tree_iter.index == 0
assert tree_iter.parent() == 1
assert tree_iter.parent() == 3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flat-tree-0.0.1a8.tar.gz
(16.0 kB
view hashes)
Built Distribution
Close
Hashes for flat_tree-0.0.1a8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03ecedf09f47a668f83e6a8c6b396045063323756baa604aeff2ff2a32245ee0 |
|
MD5 | 813e25c52cf1663d125c05ae72aeeebb |
|
BLAKE2b-256 | 26afdc3d674a5dd6d38f1a6ed0d1dd35cf28d477300020f58c068573190061fe |