{"id":29260236,"url":"https://github.com/likianta/python-tree-shaking","last_synced_at":"2026-03-08T21:36:53.187Z","repository":{"id":296992652,"uuid":"827792532","full_name":"likianta/python-tree-shaking","owner":"likianta","description":"Aggressive tree shaking based on module graph, to tremendously reduce python dependencies size by 99%.","archived":false,"fork":false,"pushed_at":"2026-03-06T09:13:25.000Z","size":462,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-06T13:28:57.463Z","etag":null,"topics":["python","python-packaging","tree-shaking"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/likianta.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-12T11:38:17.000Z","updated_at":"2026-03-06T09:01:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"352f877d-4385-4ecd-bbbd-136d635b1c2e","html_url":"https://github.com/likianta/python-tree-shaking","commit_stats":null,"previous_names":["likianta/python-tree-shaking"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/likianta/python-tree-shaking","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likianta%2Fpython-tree-shaking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likianta%2Fpython-tree-shaking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likianta%2Fpython-tree-shaking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likianta%2Fpython-tree-shaking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/likianta","download_url":"https://codeload.github.com/likianta/python-tree-shaking/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likianta%2Fpython-tree-shaking/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30274703,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T20:45:49.896Z","status":"ssl_error","status_checked_at":"2026-03-08T20:45:49.525Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["python","python-packaging","tree-shaking"],"created_at":"2025-07-04T07:38:17.028Z","updated_at":"2026-03-08T21:36:53.182Z","avatar_url":"https://github.com/likianta.png","language":"Python","readme":"# Python Tree Shaking\n\n[中文版 (最新)](./README.zh.md)\n\n*English README is under construction.*\n\n## Install\n\n```sh\npip install tree-shaking\n```\n\nBe noted `tree-shaking` requires Python \u003e= 3.12.\n\n## Usage\n\nProject tree (before):\n\n```sh\n# my example project\n/workspace/hello-world\n|= .venv\n|= hello_world\n   |- __init__.py\n   |- __main__.py\n   |- ...\n|= dist\n|- pyprojet.toml\n|- tree_shaking.yaml\n|- ...\n```\n\n\"tree_shaking.yaml\" content:\n\n```yaml\nroot: .\nsearch_paths:\n  - \u003croot\u003e/.venv/Lib/site-packages\n  - \u003croot\u003e\nentries:\n  - \u003croot\u003e/hello_world/__main__.py\n```\n\nCreate a temporary script (e.g. \"build.py\"), code like this:\n\n```python\nimport tree_shaking\ntree_shaking.build_graph_modules(\"./tree_shaking.yaml\")\ntree_shaking.dump_tree(\"./tree_shaking.yaml\", \"./dist/minified_libs\")\n```\n\nAfter running, the project tree changes:\n\n```sh\n# my example project\n/workspace/hello-world\n|= .venv\n|= hello_world\n   |- __init__.py\n   |- __main__.py\n   |- ...\n|= dist\n   |= minified_libs  # updated\n      |= ...\n|- pyprojet.toml\n|- tree_shaking.yaml\n|- ...\n```\n\nYou can temporarily exclude \".venv/Lib/site-packages\", and add \"dist/minified_libs\" to Python's `sys.path` (put it at the first place) to test if worked.\n\nAfter testing, compress \"dist/minified_libs\" to zip, and compare its size with \".venv/Lib/site-packages\" -- the more heavy dependencies you have, the more notable changes on size reduction.\n\n## Incremental Updates\n\nJust rerun \"build.py\", outputs results to the same path as last time, `tree-shaking` will find the changed parts and do only necessary adding/deleting operations to the target directory.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flikianta%2Fpython-tree-shaking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flikianta%2Fpython-tree-shaking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flikianta%2Fpython-tree-shaking/lists"}