Tree is a library for working with nested data structures.
Project description
Tree
tree
is a library for working with nested data structures. In a way, tree
generalizes the builtin map
function which only supports flat sequences,
and allows to apply a function to each "leaf" preserving the overall
structure.
>>> import tree
>>> structure = [[1], [[[2, 3]]], [4]]
>>> tree.flatten(structure)
[1, 2, 3, 4]
>>> tree.map_structure(lambda v: v**2, structure)
[[1], [[[4, 9]]], [16]]
tree
is backed by an optimized C++ implementation suitable for use in
demanding applications, such as machine learning models.
Installation
Install tree
by running:
$ pip install dm-tree
Support
If you are having issues, please let us know by filing an issue on our issue tracker.
License
The project is licensed under the Apache 2.0 license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dm-tree-0.1.6.tar.gz
(33.6 kB
view hashes)
Built Distributions
Close
Hashes for dm_tree-0.1.6-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f8a43ec475776a4e7091ef0ae01e8328f3817f723640a90d31c7acc07e830f7 |
|
MD5 | b2ef9277827e163819dce50ec934ab08 |
|
BLAKE2b-256 | 3db334cf2b203b69bf45c56699aa96a29866601a988b6ddf1fcdd3ab287c70e8 |
Close
Hashes for dm_tree-0.1.6-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91b895194a1ffc5453d27137c10f03cf9422e43ecb5c1d533f7a24eb46c71143 |
|
MD5 | fa51f4991d3fa55cd6a9cc45f13fe376 |
|
BLAKE2b-256 | 072342357b8bf5b8f2f817185be88605b0e8b868314555df03820a00c600c568 |
Close
Hashes for dm_tree-0.1.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6780c9bf3f9d388706cf02efd0866c94c85b5330c92a0989bddfdd9878cd0e8 |
|
MD5 | c598e76615212e93a832593a1a73baf6 |
|
BLAKE2b-256 | ec833e3784058aed2bcd71937343361f7b48e5fbe31dd8abf13de0ef2ca4f94c |
Close
Hashes for dm_tree-0.1.6-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51d3584b6f5c1d2d6f1fbdf3286d92313ecef894294cda3bcf35e49366d135b6 |
|
MD5 | a0566948999a469854cda344e3ab7071 |
|
BLAKE2b-256 | 1958b6ee58093358b49e33bf661a59638dcd75aca51caeb3b26598ac6ffb76f4 |
Close
Hashes for dm_tree-0.1.6-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6185d750ae7078d299262d16f0b8f2ba699a498abc8fe0e213817763796dd5f |
|
MD5 | aeb66bc0d84f0c3860bfad623a9ad0f4 |
|
BLAKE2b-256 | 267301f2e640a87fa76e0624565203188fb44da19e93f8ebd4d1d316ed7481c5 |
Close
Hashes for dm_tree-0.1.6-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5269183f80f1ae37543a2a30a8f78e4b0460d5da74fb5ac42dc8a476ef8d707e |
|
MD5 | d94cd625754a72a574c26d598afbff83 |
|
BLAKE2b-256 | f3fd46989fe958757dabc6dc7dfc813c611055c0556d4f2de5d19e34898c2c60 |
Close
Hashes for dm_tree-0.1.6-cp39-cp39-manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8425454192e954692d9a1e0f7b374b3b7030916b17b6055951dc17d58b6fe1b8 |
|
MD5 | 660b7e71051d73dd5db37d8b720d7cce |
|
BLAKE2b-256 | bd673cb9d8ece11fade868c48ff602e2ce9462f3d5eb7554295bbc0961de770e |
Close
Hashes for dm_tree-0.1.6-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd347c74254ba320d57b0e102558c1189e3b4ae1bae952f9aef156b5914567c8 |
|
MD5 | 8937afb9c0619228235b7e761ec9b7e4 |
|
BLAKE2b-256 | 502d73ae7132e3e510415a95142fc758ff890fac77927044ecc26535cce50b22 |
Close
Hashes for dm_tree-0.1.6-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e86ae05b002e825680a5da0602376da95caed24ecc54569891cfd3b1503e6786 |
|
MD5 | 3eec14cbd73638be55be42ab686f55da |
|
BLAKE2b-256 | cdbed6de74b46783e1bc14eeaff8110376d3f60e74e0e93ec03bf7fec00589d1 |
Close
Hashes for dm_tree-0.1.6-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | affc7a6d29442a143c60efb2f03bcb95424d4fe6168f3d31de892c1e601fa0e6 |
|
MD5 | bb34f3746b5fcc74fee1ea3c5b331c37 |
|
BLAKE2b-256 | ab58544554374c9581eb588525d0dda5b269ecb98dd81d7d38e28fb2974d2861 |
Close
Hashes for dm_tree-0.1.6-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d02ba486c8768dcb7c2164fa09af118526df9caf71833927d43da9efc1880f9 |
|
MD5 | 4f2331b644d7a8318e63e50c2d8de80d |
|
BLAKE2b-256 | c114cd73685b9033e89fb2d553e73343748594d8d7e4d7b66a04faef43933ac9 |
Close
Hashes for dm_tree-0.1.6-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02ffa673f20b1756dcf085ef2c354bc59416d843b384c7b71c421f873ffc36c0 |
|
MD5 | f394d6085eb27c677da07a79bac54376 |
|
BLAKE2b-256 | 077d0a188337475facc8c6e937fa68cf9d63e30e260b36ec73c55e163ab3fbc4 |
Close
Hashes for dm_tree-0.1.6-cp38-cp38-manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e87d06478356a2d92c3940dedebcd92a14ad37fba10ebb1839c8140693b83c0a |
|
MD5 | 830056b8f0b45ececd6e9a7b61d8bc76 |
|
BLAKE2b-256 | d2bafa51c09ee73d017feb982a9db531bf0d889737d2771f9dd4792bfa7d114f |
Close
Hashes for dm_tree-0.1.6-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3bec40e658fe7546c3a56849c743ac9a498e620b3236e82e171801938a56679 |
|
MD5 | 08266bff0b0af6acef63a5e5f60a3303 |
|
BLAKE2b-256 | 9c6043ee30dc849c42cb8e314cabb0dc3109d563573eee9c86c292eae04179cd |
Close
Hashes for dm_tree-0.1.6-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a69861be3f2e6d55a86c280e9625ddd9a77f0c9c9936075ad7773bfdfdca70a3 |
|
MD5 | 1c79cfaab70651109787ca0386eacb6c |
|
BLAKE2b-256 | 1bfe7a98cde81f68c70e9171aa40deb8d95a1e99a0c29f79190b60ed2813811a |
Close
Hashes for dm_tree-0.1.6-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d59c5098456667b28c607110537c86c25cbd0ee455f21d033c60ef2d7f48d81 |
|
MD5 | 9378ba5d4043a22ea183044fb76a3670 |
|
BLAKE2b-256 | 56cf49414ec256decbc209ee90fb8e809cf913919ec9d4f422d4f2de1405ad8a |
Close
Hashes for dm_tree-0.1.6-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec003873d759635ba6cc5eabc6da886bc00f6b5ec23a6baffc4fd0218231adad |
|
MD5 | 90bca6eb39b58e9d673255b0b13e4b8f |
|
BLAKE2b-256 | 1dd0dadb2f16204cdc33c27f2ccdf53da434132e12e7e99286fd4b3729a7adf0 |
Close
Hashes for dm_tree-0.1.6-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d5f64d89f657b11f429e13b1378c8cfbe4baef50e7ab31f3689bfe0cf4a2508 |
|
MD5 | ce56b3d334bc03a9071c7f07657120cc |
|
BLAKE2b-256 | c3a54e4870840cb3eba8a7bad31dde3fc88ec8fbfc7df795730c6d8c188ffbec |
Close
Hashes for dm_tree-0.1.6-cp37-cp37m-manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4e8d868fc9a75cbdb67e78069b33e62a4c69bc182c1d2adc29ab08e283912d8 |
|
MD5 | eae5faaf73fd6f142cf7eb72b773b30d |
|
BLAKE2b-256 | 445db81af6f6c27e713a0eb15cc9b28ccd6e04fbc0fda41d1a1f22690c3a6feb |
Close
Hashes for dm_tree-0.1.6-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fa9c6e56cbd22cdffec42dc8b20464872b07c4535d8effc537fe0d31930b084 |
|
MD5 | 2a3d64fa1ee731f0a4a678f848ff7898 |
|
BLAKE2b-256 | 9e6489c3b5cc21ea78e05fba0779157bd6f62e49f9fff827a841c1bc24bcb017 |
Close
Hashes for dm_tree-0.1.6-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 889eae86e0d2d4b8da8eb2edc7186b45a5f92e00c8dd77f2a5c8422f03db18f4 |
|
MD5 | 36a8e09f5da3413d43365c0f59f18e5e |
|
BLAKE2b-256 | f4d20ec55d2355344183ff5177d73c4778c421a9c32797df4292f8eb5b8a018b |
Close
Hashes for dm_tree-0.1.6-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c91e472aab5c5e083c12d0a9396bbd7695031348721f709a9c6f2449e53dab6 |
|
MD5 | d3076c8c6d52842430684ae9141b41b4 |
|
BLAKE2b-256 | 6fcd0d4472ca3864e492327db3a66f0fa954790d5fc009b854382304dfad92fc |
Close
Hashes for dm_tree-0.1.6-cp36-cp36m-manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 603392f1a7818a4f43a7033c2061ae7c2085a4a728171b0bbca76bd107fcdfb0 |
|
MD5 | b0a4bf844ba0869f90d97599b8adc3f2 |
|
BLAKE2b-256 | 1b264e7f6b335a155371eca91e8893ff87a7ed42c33660a41eaea52ca9db59c5 |
Close
Hashes for dm_tree-0.1.6-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e28ba91d3d97230b831716db401ce116ae5c7dcd025161ac16ecb8bd5c870a85 |
|
MD5 | 2b681083340c3001cb16fea6cd557fcc |
|
BLAKE2b-256 | b2b48ef1676bfca9fde09234058138416193b93f4eaf50bf17fb9c4abd141f11 |
Close
Hashes for dm_tree-0.1.6-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8814a5c838f79e9db22a51369c74f4d92e7f1485ec55d7f665ae4d98478cb4f |
|
MD5 | 16675dcaead6eb16524f702ee83816ed |
|
BLAKE2b-256 | b51796d85e97cfe727ad4be3f9f154ac893ed3606007e85b8313838ece1b1b95 |