{"id":27376742,"url":"https://github.com/getpavo/treeshake","last_synced_at":"2025-10-27T18:33:15.514Z","repository":{"id":48058575,"uuid":"362491138","full_name":"getpavo/treeshake","owner":"getpavo","description":"Automatically optimize unused CSS. Drastically improve loading times and file size.","archived":false,"fork":false,"pushed_at":"2021-08-09T16:41:10.000Z","size":635,"stargazers_count":4,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-08T21:51:32.065Z","etag":null,"topics":["css","css-python","django","flask","jackman","optimize","stylesheets","styling"],"latest_commit_sha":null,"homepage":"","language":"Cython","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getpavo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-28T14:11:07.000Z","updated_at":"2023-11-29T23:36:55.000Z","dependencies_parsed_at":"2022-08-12T17:40:40.319Z","dependency_job_id":null,"html_url":"https://github.com/getpavo/treeshake","commit_stats":null,"previous_names":["jackmanapp/treeshake"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getpavo%2Ftreeshake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getpavo%2Ftreeshake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getpavo%2Ftreeshake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getpavo%2Ftreeshake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getpavo","download_url":"https://codeload.github.com/getpavo/treeshake/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248476774,"owners_count":21110353,"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":["css","css-python","django","flask","jackman","optimize","stylesheets","styling"],"created_at":"2025-04-13T12:53:27.321Z","updated_at":"2025-10-27T18:33:10.477Z","avatar_url":"https://github.com/getpavo.png","language":"Cython","readme":"# Treeshake\n![](https://img.shields.io/pypi/status/treeshake?style=flat-square)\n![](https://img.shields.io/github/repo-size/jackmanapp/treeshake?style=flat-square)\n![](https://img.shields.io/github/last-commit/jackmanapp/treeshake?style=flat-square)\n![](https://img.shields.io/maintenance/yes/2021?style=flat-square)\n\nEver used a CSS framework and cried about all the overhead it caused? Ever wrote so much CSS that you were no longer aware what parts of it were actually used? Fear no more. Just use `treeshake` before deployment and all of your troubles will melt away.\n\n## Dead code elimination\nTree shaking is a concept mostly used in ECMAScript languages like Dart, JavaScript and Typescript that helps to eliminate unused code. Optimizing your code in a single bundle.\n\nThis project aims to bring the power of tree shaking for css to your Python projects. This small library is written in [Cython](https://cython.readthedocs.io/) and allows you to get the best performance out of your (potentially) bloated web applications.\n\n## Installation\nIt is recommended to install treeshake via pip:\n```commandline\npip install treeshake\n```\n\n## Command Line Support\nTo quickly use treeshake, call it via command line:\n```commandline\nshake \u003ccss dir\u003e \u003chtml dir\u003e\npython3 -m treeshake \u003ccss dir\u003e \u003chtml directory\u003e\n```\nIf you wish to see an interactive prompt, just use `shake` or `python3 -m treeshake`. The current support is only for a single directory.\nTo see help, please run: `shake -h`.\n\n## Quick example\nThe following piece of codes recursively adds all css files from `/styles/` and all html files from `/html` and compares the contents. Where possible, it will eliminate styling.\n\nThe new file is written to the `/out/` output directory.\n\n```python\nfrom treeshake import Shaker\n\ntreeshaker = Shaker()\ntreeshaker.discover_add_stylesheets('./styles/', True)\ntreeshaker.discover_add_html('./html/', True)\ntreeshaker.optimize('./out')\n```\n\n## Contributing\nAny contribution to this project is very welcome. Please open an issue when you are dealing with a problem or want to discuss a feature. All contributions are handled by pull requests.\n\nPlease refer to [CONTRIBUTING.md](https://github.com/jackmanapp/treeshake/blob/main/CONTRIBUTING.md) for more information.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetpavo%2Ftreeshake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetpavo%2Ftreeshake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetpavo%2Ftreeshake/lists"}