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.5.tar.gz (34.0 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.5-cp38-cp38-win_amd64.whl (84.0 kB view details)

Uploaded CPython 3.8Windows x86-64

dm_tree-0.1.5-cp38-cp38-manylinux2014_x86_64.whl (91.6 kB view details)

Uploaded CPython 3.8

dm_tree-0.1.5-cp38-cp38-macosx_10_14_x86_64.whl (95.1 kB view details)

Uploaded CPython 3.8macOS 10.14+ x86-64

dm_tree-0.1.5-cp37-cp37m-win_amd64.whl (86.0 kB view details)

Uploaded CPython 3.7mWindows x86-64

dm_tree-0.1.5-cp37-cp37m-manylinux1_x86_64.whl (294.7 kB view details)

Uploaded CPython 3.7m

dm_tree-0.1.5-cp37-cp37m-macosx_10_9_x86_64.whl (94.3 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

dm_tree-0.1.5-cp36-cp36m-win_amd64.whl (86.0 kB view details)

Uploaded CPython 3.6mWindows x86-64

dm_tree-0.1.5-cp36-cp36m-manylinux1_x86_64.whl (294.6 kB view details)

Uploaded CPython 3.6m

dm_tree-0.1.5-cp36-cp36m-macosx_10_9_x86_64.whl (94.4 kB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

dm_tree-0.1.5-cp35-cp35m-win_amd64.whl (86.0 kB view details)

Uploaded CPython 3.5mWindows x86-64

dm_tree-0.1.5-cp35-cp35m-manylinux1_x86_64.whl (294.6 kB view details)

Uploaded CPython 3.5m

dm_tree-0.1.5-cp35-cp35m-macosx_10_9_intel.whl (94.4 kB view details)

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

dm_tree-0.1.5-cp27-cp27mu-manylinux1_x86_64.whl (295.1 kB view details)

Uploaded CPython 2.7mu

dm_tree-0.1.5-cp27-cp27m-win_amd64.whl (86.6 kB view details)

Uploaded CPython 2.7mWindows x86-64

dm_tree-0.1.5-cp27-cp27m-macosx_10_9_x86_64.whl (94.9 kB view details)

Uploaded CPython 2.7mmacOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: dm-tree-0.1.5.tar.gz
  • Upload date:
  • Size: 34.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

File hashes

Hashes for dm-tree-0.1.5.tar.gz
Algorithm Hash digest
SHA256 a951d2239111dfcc468071bc8ff792c7b1e3192cab5a3c94d33a8b2bda3127fa
MD5 355ca2d5845fe198ced4b147f698c116
BLAKE2b-256 700abc3e9865603332c525fc218aceb023762aeffc2a86ff99b347b67ee3f2a8

See more details on using hashes here.

File details

Details for the file dm_tree-0.1.5-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: dm_tree-0.1.5-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 84.0 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

File hashes

Hashes for dm_tree-0.1.5-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 3ed4a2c3328603fa06c2104921b31faf3e831e9828ed625bb0e0813dc2c8a17f
MD5 d8344f8fa96c1e5103e18e1362e09519
BLAKE2b-256 87426a99209e763ba4b9cbf29e754dfe0d7bfeee93b4193b7d67616a37833077

See more details on using hashes here.

File details

Details for the file dm_tree-0.1.5-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

  • Download URL: dm_tree-0.1.5-cp38-cp38-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 91.6 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

File hashes

Hashes for dm_tree-0.1.5-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 134b58263e09a6e552c05c85c630f424446b75600bd38ff1838329eb0cbe0e50
MD5 a14aa3a927928e6d25abadbfac6812d8
BLAKE2b-256 a8cc63ecd7ce85f998c11ae0ea2909ebc0f53751ce379099c10f887b4e6554ee

See more details on using hashes here.

File details

Details for the file dm_tree-0.1.5-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: dm_tree-0.1.5-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 95.1 kB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

File hashes

Hashes for dm_tree-0.1.5-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 669c8a7929d350db2ba7354e030d8b7318ba94d4cc5702858beed2219f0566be
MD5 c514f6d68f609c9ac4f838d817afd2d2
BLAKE2b-256 54d3aeca13bf1815da5cd06596f9cfd22a4a64d242403261c6cc4ec2754814b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.5-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 86.0 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.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

File hashes

Hashes for dm_tree-0.1.5-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 23707e6d4c2ee4567f341429b7b358c3108cf5130f0897bdee54b3aa890de220
MD5 682eeec6fae256a3ba608d1de8afebdb
BLAKE2b-256 13173cea41a2b66a26bfc52a1a7a5d0d3d060f0552aaaba77659674fabbf14a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.5-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 294.7 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

File hashes

Hashes for dm_tree-0.1.5-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 be6e8173eb8e0f3d03a93abadf6eae6581219b6b408fa835e2eac04e775f0969
MD5 ebb6581b0ff4061fada238ed7a5524b5
BLAKE2b-256 6bd96d88e8d32bb454c4ef8f50c62714b0eb20170f4c1d2cd316e0d99755405e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.5-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 94.3 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.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

File hashes

Hashes for dm_tree-0.1.5-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6caa5308f139aeef22c64c55cf6bb7e6882a4119eac48c7cc572e2388d379598
MD5 be7bd966c5311ec465e93ee6b1f73959
BLAKE2b-256 13c2079b00ebf0cfb7804df3e7547d4e24ad0142d81ed178716a651c33ccc632

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.5-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 86.0 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.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

File hashes

Hashes for dm_tree-0.1.5-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 a13ebfdce7b47310ba02e14005971de12d7d30e082e17f3a73f3f309a53b926e
MD5 2294357dd78a7b3c1228a454f1bb752a
BLAKE2b-256 6b7aea94f81dbafb83981c161490f56b2b4d0cca1cd003633ae3e61b4b6a6e8c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.5-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 294.6 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

File hashes

Hashes for dm_tree-0.1.5-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 12e662dadd3f0d3e729cbc5a8a8aef88606339d056c95dc83c1e467e6330ba9a
MD5 5991f7fa1201621bb9ede9b570e38a39
BLAKE2b-256 164810fb721334810081b7e6eebeba0d12e12126c76993e8c243062d2f56a89f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.5-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 94.4 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.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

File hashes

Hashes for dm_tree-0.1.5-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 90706db66bd8dd4b71c00dfd883d83bca6be238093e2db3d46331085b3a12214
MD5 12fc94eb81870b903d1938e22d377733
BLAKE2b-256 e0afd60d32acf5e9c3511cfffbd2bf72d55fdf3ca01c116631120addfda70226

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.5-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 86.0 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.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

File hashes

Hashes for dm_tree-0.1.5-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 4992e3517a6d5f6211b8240784ec0006927945fbf9feb56c37c8068a80e211af
MD5 4ade7cfa340ac8a1338fb99cf42b0eac
BLAKE2b-256 028ba2e4c6db0b2edfab0deb73ee0911b69274eb111c0f9c8db4d713531c8167

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.5-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 294.6 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

File hashes

Hashes for dm_tree-0.1.5-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 21775e6a4d5afafa65514db435dba71637edccb145ec8fd7f144355e9d14d6e2
MD5 be19989d26327a38892ec8a683cfd851
BLAKE2b-256 bf2fbdd4d8581d89282a0befdb923fe4bafeb9b624a399aadf60e2fed8af08cc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.5-cp35-cp35m-macosx_10_9_intel.whl
  • Upload date:
  • Size: 94.4 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.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

File hashes

Hashes for dm_tree-0.1.5-cp35-cp35m-macosx_10_9_intel.whl
Algorithm Hash digest
SHA256 3f7d29c6130f8cb41ee862c96f752dd37c35e6c4cdbf3aaa0db9a3c8516892e2
MD5 c9a9958119b3aeed33f947d7b1b7a72b
BLAKE2b-256 521f385365c8924817c86c53463342ed53a0d34c06859415944c77dbcec688d8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.5-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 295.1 kB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

File hashes

Hashes for dm_tree-0.1.5-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9699c10c3c58bcc8d221445c7864ff9e3e738e629f1943efdb818c4fd4083326
MD5 2445bfbf2b02486799f2c62fdebcd6fe
BLAKE2b-256 67e5f16d6ae10be4c0b3be541a9f6f1413f8530369b58e913e71a65d91334281

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.5-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 86.6 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.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

File hashes

Hashes for dm_tree-0.1.5-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 e4314cd65c5d2218fe580c265e005b334d609e51c33746fedd4014006fca7fa2
MD5 f8d073c281185970f7b8bc95adda45d8
BLAKE2b-256 9521ab6112809cecda656be71ecb8f815a56d73a2491a0d45f5020c6118e9ecb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.5-cp27-cp27m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 94.9 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.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.7

File hashes

Hashes for dm_tree-0.1.5-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 39a2c12d86b9df7bcb64c3473957744bc1af812dd7bf27c01108f17ed688644b
MD5 71efeeb70c694ec74bff7798772c38d1
BLAKE2b-256 947f8fbe58e93985d7aef816e5f4c3e6834451c9c481f3185b1969d3bd344ac2

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