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
Built Distribution
File details
Details for the file flat-tree-0.0.1a8.tar.gz
.
File metadata
- Download URL: flat-tree-0.0.1a8.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.9 CPython/3.8.0 Linux/4.9.0-12-amd64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6fe90ec5dcd5ac353c04440bbe8d19631258b04297a6464fbd7a425e2c9c80a |
|
MD5 | 10fc92d5f9a7bb2d179b5d5640cd1418 |
|
BLAKE2b-256 | 78590b78aee83f114f778eb87fdcbfed972c1ffcf4f7b621fc70d09ac5f0154a |
File details
Details for the file flat_tree-0.0.1a8-py3-none-any.whl
.
File metadata
- Download URL: flat_tree-0.0.1a8-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.9 CPython/3.8.0 Linux/4.9.0-12-amd64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03ecedf09f47a668f83e6a8c6b396045063323756baa604aeff2ff2a32245ee0 |
|
MD5 | 813e25c52cf1663d125c05ae72aeeebb |
|
BLAKE2b-256 | 26afdc3d674a5dd6d38f1a6ed0d1dd35cf28d477300020f58c068573190061fe |