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.2.tar.gz (31.5 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.2-cp37-cp37m-win_amd64.whl (86.0 kB view details)

Uploaded CPython 3.7mWindows x86-64

dm_tree-0.1.2-cp37-cp37m-manylinux1_x86_64.whl (290.7 kB view details)

Uploaded CPython 3.7m

dm_tree-0.1.2-cp37-cp37m-macosx_10_9_x86_64.whl (94.7 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

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

Uploaded CPython 3.6mWindows x86-64

dm_tree-0.1.2-cp36-cp36m-manylinux1_x86_64.whl (290.8 kB view details)

Uploaded CPython 3.6m

dm_tree-0.1.2-cp36-cp36m-macosx_10_9_x86_64.whl (94.7 kB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

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

Uploaded CPython 3.5mWindows x86-64

dm_tree-0.1.2-cp35-cp35m-manylinux1_x86_64.whl (290.8 kB view details)

Uploaded CPython 3.5m

dm_tree-0.1.2-cp35-cp35m-macosx_10_9_intel.whl (94.7 kB view details)

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

dm_tree-0.1.2-cp27-cp27mu-manylinux1_x86_64.whl (295.3 kB view details)

Uploaded CPython 2.7mu

dm_tree-0.1.2-cp27-cp27m-win_amd64.whl (86.5 kB view details)

Uploaded CPython 2.7mWindows x86-64

dm_tree-0.1.2-cp27-cp27m-macosx_10_9_x86_64.whl (95.2 kB view details)

Uploaded CPython 2.7mmacOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for dm-tree-0.1.2.tar.gz
Algorithm Hash digest
SHA256 41b102cd06fb32c87c8bb35efa18aa6fc76db6359703f0858d588cd66d46c716
MD5 516e044434aa08a1fe07df50433a9da1
BLAKE2b-256 5d26cd2b72779f7f448894837c1c11ad3bb73dfdeffa3b77d80235c1ba39fa9f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.2-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/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 1e901438a2ed2831cae120120da8eb623cc61b2dfa22b22b3e5e7dba36275eb1
MD5 54b354703465bd35989c940d8ab026f7
BLAKE2b-256 bd44e1ecb84ae655f15815b1cc5077762081d4406d982bccfaee7fcb5fd649e3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.2-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 290.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.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5bddc7379f38a2ebf7895217599a9e7409d8953581f9aedc3092f83ae344f9fc
MD5 73e3c8ede206124243816719d3dfc657
BLAKE2b-256 104b565773de5faeae2e3058a034a708eb6ebbbb22d7e6104e382f204179dac5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.2-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 94.7 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.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e1f0cc82981b0e241e9b76d0ff5938ceaa3fc27e8d4a8a0fd55138cc13e77d14
MD5 564ef2feb301d7d9f088bcddc4bf5199
BLAKE2b-256 b83158b146b0bf722b4fa623a37faf8662d0c2ddf194861b5fec6935d48c3965

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.2-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/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 2145e27cc964205e8ba428103c6bb0fca3c47fbca020b20a07ad3e479aca4b90
MD5 6ff97c5877eaf535dde7576e28c7d6dd
BLAKE2b-256 2f1ca5384062d1ad166e0ee10138243bf6b6f21d1571973059e044a2d0c8d01d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.2-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 290.8 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.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8640801c2f885a31e3acbbaf18409834922ef18978227829407ba5c8db865def
MD5 a71944c2e7a80a394205ed2753b689ca
BLAKE2b-256 b909d2fb712fb41123cbcf1a513ae6f958259087029050b0a0d64c7b4f02a878

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.2-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 94.7 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.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 577cb4be57002d22ab80de761b42da7c2c2ce850d733edb799054c860f39d984
MD5 93969473700b3b971fa46e7739c4efc4
BLAKE2b-256 1e7a6e6d31b8265524c81460a7e625cf262bd6df034883be3b42003c470a9a82

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.2-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/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 1e027d58cc483efc0380aa3d5800d544c75672e87b851a31e989a97eac7d1f4a
MD5 8cbfd0ecaa0fd2b2e1d133b9b472799e
BLAKE2b-256 427c4cf1b99cd7a60c026f34e2ca4bf785f965c7b8ee43bd6323a6f0d092f41e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.2-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 290.8 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.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1775af3fd2a6e65e2bb76a1fb9fa594437db792d6e90e886dceee64157e92eaf
MD5 a55e10dab725637417968322a78f17cc
BLAKE2b-256 9488c86c9f426f5624ada4e8ef3365c63769afe14d04ad2f3ff121de90b6f6d4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.2-cp35-cp35m-macosx_10_9_intel.whl
  • Upload date:
  • Size: 94.7 kB
  • Tags: CPython 3.5m, macOS 10.9+ 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.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.2-cp35-cp35m-macosx_10_9_intel.whl
Algorithm Hash digest
SHA256 5b3755366aecae6b81239154ffa6d286e9c36629e7ad0577d656353b3c431dd8
MD5 6db198e363195ed4eb93648488661c27
BLAKE2b-256 a1b729c12527ba1b851024a926c05febc7c13cbb320c89b090dce4796599334b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.2-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 295.3 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.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.2-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6267ae4f866cf11a7477de4f70e059c6663a6703c33887e0b10d983805e5bc75
MD5 ab802c9fe37327b6693584330c290318
BLAKE2b-256 9d3d3d400ba7753eea6c2a0d902e220f995c8aba0051184e45b3bc395167ec67

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.2-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 86.5 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.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.2-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 3ba4126bdc14cb130c1da52802fc03aadf082d9b9a46aec3e3d0c374c3d1b626
MD5 bd04accb36d7c8cd711e2328948ab86f
BLAKE2b-256 b6a62aee606c232522f71768d5d5b1f81838dd30276e79fd5d46ec4a7780599d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dm_tree-0.1.2-cp27-cp27m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 95.2 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.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5rc1

File hashes

Hashes for dm_tree-0.1.2-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1406ff426be4d4e6a3818dc07487dd7cfde0662f31c464ef71c7875663693489
MD5 435af075cec6670fad34c644cf2499b2
BLAKE2b-256 7954ecfc065f27821a422dbef376a2f0f57bf46d69465d2a4af5ea4b6e0f815a

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