Skip to main content

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.4.tar.gz (33.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dm_tree-0.1.4-cp37-cp37m-win_amd64.whl (85.1 kB view details)

Uploaded CPython 3.7mWindows x86-64

dm_tree-0.1.4-cp37-cp37m-manylinux1_x86_64.whl (293.8 kB view details)

Uploaded CPython 3.7m

dm_tree-0.1.4-cp37-cp37m-macosx_10_9_x86_64.whl (93.5 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

dm_tree-0.1.4-cp36-cp36m-win_amd64.whl (85.1 kB view details)

Uploaded CPython 3.6mWindows x86-64

dm_tree-0.1.4-cp36-cp36m-manylinux1_x86_64.whl (293.8 kB view details)

Uploaded CPython 3.6m

dm_tree-0.1.4-cp36-cp36m-macosx_10_9_x86_64.whl (93.5 kB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

dm_tree-0.1.4-cp35-cp35m-win_amd64.whl (85.2 kB view details)

Uploaded CPython 3.5mWindows x86-64

dm_tree-0.1.4-cp35-cp35m-manylinux1_x86_64.whl (293.8 kB view details)

Uploaded CPython 3.5m

dm_tree-0.1.4-cp35-cp35m-macosx_10_9_intel.whl (93.5 kB view details)

Uploaded CPython 3.5mmacOS 10.9+ Intel (x86-64, i386)

dm_tree-0.1.4-cp27-cp27mu-manylinux1_x86_64.whl (294.2 kB view details)

Uploaded CPython 2.7mu

dm_tree-0.1.4-cp27-cp27m-win_amd64.whl (85.7 kB view details)

Uploaded CPython 2.7mWindows x86-64

dm_tree-0.1.4-cp27-cp27m-macosx_10_9_x86_64.whl (94.0 kB view details)

Uploaded CPython 2.7mmacOS 10.9+ x86-64

File details

Details for the file dm-tree-0.1.4.tar.gz.

File metadata

  • Download URL: dm-tree-0.1.4.tar.gz
  • Upload date:
  • Size: 33.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.5

File hashes

Hashes for dm-tree-0.1.4.tar.gz
Algorithm Hash digest
SHA256 c4477ba8fee2fd7113ce0ef48a5bcf4f881100dcf5e609853368bbab96f4095e
MD5 ba9442803c1d0a6a6ba95b7728682442
BLAKE2b-256 e9e23a6413fd1804325ba42dc05a6dfc29bf47f3ab7122b2da8feda5fcbaff59

See more details on using hashes here.

File details

Details for the file dm_tree-0.1.4-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: dm_tree-0.1.4-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 85.1 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.5

File hashes

Hashes for dm_tree-0.1.4-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 2d57222159daeb79032fd888f0deb515930e92295f18c8dd75a11c98775a981e
MD5 17989d60e1aef4e3b24db0212c720aa3
BLAKE2b-256 9e46d2de3d3cdc2fc777f88ffc8b775c4cc6cba44f84f3724e805cdab6fc2deb

See more details on using hashes here.

File details

Details for the file dm_tree-0.1.4-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: dm_tree-0.1.4-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 293.8 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.5

File hashes

Hashes for dm_tree-0.1.4-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 99368fe31719ecb82d479b5a4316b74771b2377c501a956b020a79f55bf1879b
MD5 6d0e7dc21a287702fcebaa46528c6987
BLAKE2b-256 1b9066c1bdf751a78437e29c620429b696cd32674f6b0214bc4625ae60a4d7e7

See more details on using hashes here.

File details

Details for the file dm_tree-0.1.4-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: dm_tree-0.1.4-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 93.5 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.5

File hashes

Hashes for dm_tree-0.1.4-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 20a1bc9b5836d34d85c7f045202a5002b74f452afa557253d1dcd36b1537c73b
MD5 54661e38a1eb4e984508cffce07d98e0
BLAKE2b-256 4f2ed96cc0b1c2a1d3b0e988c84dddb51e9bc5cd8ad1453a0c825e4786862f87

See more details on using hashes here.

File details

Details for the file dm_tree-0.1.4-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: dm_tree-0.1.4-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 85.1 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.5

File hashes

Hashes for dm_tree-0.1.4-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 62bea8b7c29ab13e7057a20bef530915741e7c956e8707d930632ff69f60d343
MD5 97683ae9c3be349fa8d31415a49c6a53
BLAKE2b-256 39b2b26c2f79472912b63885a6867c0011706ea39c99d736a8ba9f59d7ba0ea5

See more details on using hashes here.

File details

Details for the file dm_tree-0.1.4-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: dm_tree-0.1.4-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 293.8 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.5

File hashes

Hashes for dm_tree-0.1.4-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5a2289b45ecfbdb46047c391d25640aa7f2bfff86d5fc8ec132fd99c522f87cf
MD5 faf855de495395f87b1f12e88d474e2a
BLAKE2b-256 ee47948602fe82595056eb7f14b5005ee525c62a73218ffffe2aabb6b9e3ed42

See more details on using hashes here.

File details

Details for the file dm_tree-0.1.4-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: dm_tree-0.1.4-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 93.5 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.5

File hashes

Hashes for dm_tree-0.1.4-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 84508d1bbf551a1a3e6e604149ef0aff4afb79d52da14894a198290558e84d09
MD5 ae2d3d373ba90624cb08666d66cf7f28
BLAKE2b-256 71f1111b7bc771dbdb027a78eda54ff3455b69f4c312ff341da0f06c7f6bd8a7

See more details on using hashes here.

File details

Details for the file dm_tree-0.1.4-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: dm_tree-0.1.4-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 85.2 kB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.5

File hashes

Hashes for dm_tree-0.1.4-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 e6f7f399ffbb006f19121b5d20d3af79ea941d51932360765591ad867442f2a2
MD5 b317e4be33dfb96bc295ffa8d9a84ac6
BLAKE2b-256 821e14fdfd763698f363e2fffe6fb6edd7151514f47e1bfccddc5b9870f883ba

See more details on using hashes here.

File details

Details for the file dm_tree-0.1.4-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: dm_tree-0.1.4-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 293.8 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.5

File hashes

Hashes for dm_tree-0.1.4-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 394bfb0a19f4a3ac4198391409aaabd15b15f2968fc68397b12cc676dfe85e0f
MD5 12172baf653967437d20f23da2971d52
BLAKE2b-256 6ab37f137e5b51013c4b9dbd350e4f1ab88c1feab8a8776220eb8ba52228910f

See more details on using hashes here.

File details

Details for the file dm_tree-0.1.4-cp35-cp35m-macosx_10_9_intel.whl.

File metadata

  • Download URL: dm_tree-0.1.4-cp35-cp35m-macosx_10_9_intel.whl
  • Upload date:
  • Size: 93.5 kB
  • Tags: CPython 3.5m, macOS 10.9+ Intel (x86-64, i386)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.5

File hashes

Hashes for dm_tree-0.1.4-cp35-cp35m-macosx_10_9_intel.whl
Algorithm Hash digest
SHA256 dec531bec7bbd56417343a8c2fea30bd76319ee0e83de0e130cf343bef8c4f9f
MD5 5f629241b82f86f1ae0171112ebd51fa
BLAKE2b-256 31bb2254ba217627c083628ee1932ee230b7f445c52ef746b2b82001512d3307

See more details on using hashes here.

File details

Details for the file dm_tree-0.1.4-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

  • Download URL: dm_tree-0.1.4-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 294.2 kB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.5

File hashes

Hashes for dm_tree-0.1.4-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d78cbc7d8445e85a399fcda854d180a9b3a9c66de4784e0299f50ed7e540be7b
MD5 a4674790b725e270ad4fe8fce03e4eec
BLAKE2b-256 4f292d1fc4b9b02489f1b0ff2d0a0fcd1ad2ef0617fa3d9a006a626dc7d7c74a

See more details on using hashes here.

File details

Details for the file dm_tree-0.1.4-cp27-cp27m-win_amd64.whl.

File metadata

  • Download URL: dm_tree-0.1.4-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 85.7 kB
  • Tags: CPython 2.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.5

File hashes

Hashes for dm_tree-0.1.4-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 c04e16932b99a0662e9bf1d5522ab42390025b159c182dcf9e87117b1dfb93a7
MD5 fab64d991edb38d65579de30b2819182
BLAKE2b-256 23ac363dc53e436c871f2223e7b94d530a4bf97b7644840cc81b1c64039c9808

See more details on using hashes here.

File details

Details for the file dm_tree-0.1.4-cp27-cp27m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: dm_tree-0.1.4-cp27-cp27m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 94.0 kB
  • Tags: CPython 2.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.5

File hashes

Hashes for dm_tree-0.1.4-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e11e47a832924f6ff6fae1179b82a7f5e2c2c191332d2cb69734d03316ac444e
MD5 b769bfd92760f8f93cdac1811c006317
BLAKE2b-256 3a38b3c6964f5d12eaea363da26bc0f6bb1672ece8545e3662608f96834da4b0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page