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.1.tar.gz (31.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.1-cp37-cp37m-win_amd64.whl (84.5 kB view details)

Uploaded CPython 3.7mWindows x86-64

dm_tree-0.1.1-cp37-cp37m-manylinux1_x86_64.whl (289.7 kB view details)

Uploaded CPython 3.7m

dm_tree-0.1.1-cp37-cp37m-macosx_10_9_x86_64.whl (83.1 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

dm_tree-0.1.1-cp36-cp36m-win_amd64.whl (84.5 kB view details)

Uploaded CPython 3.6mWindows x86-64

dm_tree-0.1.1-cp36-cp36m-manylinux1_x86_64.whl (289.7 kB view details)

Uploaded CPython 3.6m

dm_tree-0.1.1-cp36-cp36m-macosx_10_9_x86_64.whl (83.1 kB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

dm_tree-0.1.1-cp35-cp35m-win_amd64.whl (84.5 kB view details)

Uploaded CPython 3.5mWindows x86-64

dm_tree-0.1.1-cp35-cp35m-manylinux1_x86_64.whl (289.7 kB view details)

Uploaded CPython 3.5m

dm_tree-0.1.1-cp35-cp35m-macosx_10_6_intel.whl (83.1 kB view details)

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

dm_tree-0.1.1-cp27-cp27mu-manylinux1_x86_64.whl (294.4 kB view details)

Uploaded CPython 2.7mu

dm_tree-0.1.1-cp27-cp27m-win_amd64.whl (85.1 kB view details)

Uploaded CPython 2.7mWindows x86-64

dm_tree-0.1.1-cp27-cp27m-macosx_10_9_x86_64.whl (83.7 kB view details)

Uploaded CPython 2.7mmacOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: dm-tree-0.1.1.tar.gz
  • Upload date:
  • Size: 31.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm-tree-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6abcec0f84d39113a3b2ebdf1a5973a7b1ca3ffbd313a1d30f4d8de156421b77
MD5 4c404bd358997ac002946292bfbd5004
BLAKE2b-256 884eb1a79e99e024780ef4ad675babacd719fe61588e91a2c46788242071bd14

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 84.5 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 06d49995609d2a90cc9de542582b93a67867bb89e84c322073c08704a905fb5e
MD5 a23b4058092038477bff1cee3b9bfdee
BLAKE2b-256 bad743a33fc1c9ea5e0d2d545ccd5f661ad0fabe3249399e812f7a501947a38b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.1-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 289.7 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e5eaae1ba83f29c2946dd34ba4525665892441bd46c96e0b37b511f4a7d4f64d
MD5 3596f43c2ded8b521bcc5b54e4786f52
BLAKE2b-256 861a6ac9014802461e9d74d83ccb298a4cdbd4921e42ae8fffba766608200321

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.1-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 83.1 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 31adfbde8b68ddc2d466c17d2c9b2f2780209a1fa1e5ebe93212d834b4b34654
MD5 ab8a81c26d4051cf3b2606dfe645ecce
BLAKE2b-256 3106af3786d8743cb04d3896a2839ae7c5c8e1fc320e72086ab224cc0a777c20

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.1-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 84.5 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 3acdd17e4c267fd40db5bef805e9b26bd247c9eb46c6c45c6498fbfc6d9da570
MD5 d1c2fe9013a0fca841e2f6faac62eb14
BLAKE2b-256 7fae61ab96a5d6e49640144e3298a6a5030d4169a1b193b9dda3de187ae019d4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.1-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 289.7 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a6cf1f7300e72404b06bc4263e94debcdd3b641fb41e28dcb5a3b5142d11b270
MD5 db851507ee26267831b61bb5cd9802ae
BLAKE2b-256 906265ac656781ed48b4ca1c82ca941465d50c951aa17232ef440e4ecd96f4b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.1-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 83.1 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a1443694342d7732917bf52c61f6b147f440f61769f8592ae0cbbdf77a53e4de
MD5 8b264d2f80e6314b8fbe7261a2f98fa9
BLAKE2b-256 84d19e690a1a4efb1d0cedaa5f41e5f0d93eb0d534cb41e5a36c11f40be99d81

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.1-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 84.5 kB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 ab957118f6746d9c21ef8678a2cb4dcd99761447334a8c67dc6968e819604177
MD5 9f13dad850c8da7a0a6acc6aec09c74b
BLAKE2b-256 6723131006b82875c1721abd32f7d9b78c8f8696555dd7e93066fe66af392801

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.1-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 289.7 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 909633d01631fddb929bda33991a71a5b2deb7dd75ee02121793df71ce85d38a
MD5 f40973c4f88d69cf48e6bd0f43a9a52a
BLAKE2b-256 b773cf0d93f3d4ddc8f86809825225a8d2cec53374376602e60a0298c062562d

See more details on using hashes here.

File details

Details for the file dm_tree-0.1.1-cp35-cp35m-macosx_10_6_intel.whl.

File metadata

  • Download URL: dm_tree-0.1.1-cp35-cp35m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 83.1 kB
  • Tags: CPython 3.5m, macOS 10.6+ Intel (x86-64, i386)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.1-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 f7608dec7bee88726e6801c5879342b6a824a30f74ffe289023f3adbd7ca5ee4
MD5 9ac49bab1ef78225ea17c594c4210bc7
BLAKE2b-256 3c874319508bd54f77d6dce98fcfaf98ae8a0aada6b744e60ae95fb52c7d0c3d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.1-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 294.4 kB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 dcd15431b29f6f7f1e7582c179e70868d43a90708c4a32746c63600fd7466b2e
MD5 5851ace84222557928055a4b5f377595
BLAKE2b-256 176de5240793d23776df4318ea30ca88c38a01121daae84c51fcbaaf6bef2cdb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.1-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 85.1 kB
  • Tags: CPython 2.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.1-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 6f8508ef1428c2c64a8411c8634dd9421e15d8508abc5638f111aa6dc63d8228
MD5 9b56fd853d79f126f1299f5347259325
BLAKE2b-256 c4d24719d746cf92ccedfb25d26692ac055c2ebb531f343fde3a73c97bb089b6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.1-cp27-cp27m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 83.7 kB
  • Tags: CPython 2.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.1-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2e1c51bc40090d85ee7b7ab3b7dbe8a4dd25c8eb7e187edc4cb0d6a9b6a79416
MD5 d3eef2615f08c615edee91c522e609c7
BLAKE2b-256 6dee06a735f9b4643cfe670ddfd89dc05c12c2b0d49ac75288ab572902dc880a

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