{"id":13689163,"url":"https://github.com/google-deepmind/tree","last_synced_at":"2025-05-14T23:02:01.029Z","repository":{"id":35853978,"uuid":"213594960","full_name":"google-deepmind/tree","owner":"google-deepmind","description":"tree is a library for working with nested data structures","archived":false,"fork":false,"pushed_at":"2025-01-30T17:23:31.000Z","size":156,"stargazers_count":977,"open_issues_count":33,"forks_count":61,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-13T19:43:20.022Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://tree.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google-deepmind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-08T08:57:45.000Z","updated_at":"2025-04-10T20:27:51.000Z","dependencies_parsed_at":"2023-09-07T20:34:55.783Z","dependency_job_id":"4e98a711-5753-4196-a981-00341402e19f","html_url":"https://github.com/google-deepmind/tree","commit_stats":{"total_commits":95,"total_committers":19,"mean_commits":5.0,"dds":0.4842105263157894,"last_synced_commit":"63f25d4e05440ccbd4ba662be5f3f6eb460d29d8"},"previous_names":["google-deepmind/tree","deepmind/tree"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-deepmind%2Ftree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-deepmind%2Ftree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-deepmind%2Ftree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google-deepmind%2Ftree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google-deepmind","download_url":"https://codeload.github.com/google-deepmind/tree/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254243353,"owners_count":22038044,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T15:01:36.266Z","updated_at":"2025-05-14T23:02:00.956Z","avatar_url":"https://github.com/google-deepmind.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Tree\n\n`tree` is a library for working with nested data structures. In a way, `tree`\ngeneralizes the builtin `map` function which only supports flat sequences,\nand allows to apply a function to each \"leaf\" preserving the overall\nstructure.\n\n```python\n\u003e\u003e\u003e import tree\n\u003e\u003e\u003e structure = [[1], [[[2, 3]]], [4]]\n\u003e\u003e\u003e tree.flatten(structure)\n[1, 2, 3, 4]\n\u003e\u003e\u003e tree.map_structure(lambda v: v**2, structure)\n[[1], [[[4, 9]]], [16]]\n```\n\n`tree` is backed by an optimized C++ implementation suitable for use in\ndemanding applications, such as machine learning models.\n\n## Installation\n\nFrom PyPI:\n\n```shell\n$ pip install dm-tree\n```\n\nDirectly from github using pip:\n\n```shell\n$ pip install git+git://github.com/deepmind/tree.git\n```\n\nBuild from source:\n\n```shell\n$ python setup.py install\n```\n\n## Support\n\nIf you are having issues, please let us know by filing an issue on our\n[issue tracker](https://github.com/deepmind/tree/issues).\n\n## License\n\nThe project is licensed under the Apache 2.0 license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle-deepmind%2Ftree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle-deepmind%2Ftree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle-deepmind%2Ftree/lists"}