{"id":20013754,"url":"https://github.com/gregorybchris/dirstuff","last_synced_at":"2026-02-19T01:02:58.034Z","repository":{"id":57418290,"uuid":"230900088","full_name":"gregorybchris/dirstuff","owner":"gregorybchris","description":"Utilities for filesystem operations","archived":false,"fork":false,"pushed_at":"2024-06-30T06:38:20.000Z","size":776,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-23T01:41:42.703Z","etag":null,"topics":["copy","create","delete","directory","file","filesystem","folder","operation","recursive","rename","save"],"latest_commit_sha":null,"homepage":"","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/gregorybchris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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-12-30T11:01:17.000Z","updated_at":"2024-09-25T03:50:16.000Z","dependencies_parsed_at":"2023-11-22T07:26:26.492Z","dependency_job_id":"5bb363ef-b9b5-4f59-9136-12a5a9e404a9","html_url":"https://github.com/gregorybchris/dirstuff","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"3be51f7aaccf1cb7ab524c9833d350fd5fe1cbf4"},"previous_names":["gregorybchris/dirsum"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gregorybchris/dirstuff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregorybchris%2Fdirstuff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregorybchris%2Fdirstuff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregorybchris%2Fdirstuff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregorybchris%2Fdirstuff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gregorybchris","download_url":"https://codeload.github.com/gregorybchris/dirstuff/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregorybchris%2Fdirstuff/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011280,"owners_count":26084928,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["copy","create","delete","directory","file","filesystem","folder","operation","recursive","rename","save"],"created_at":"2024-11-13T07:37:45.641Z","updated_at":"2025-10-12T12:07:53.298Z","avatar_url":"https://github.com/gregorybchris.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"assets/dirstuff-banner.png\"\u003e\n  \u003ch1\u003edirstuff\u003c/h1\u003e\n\n  \u003cp\u003e\n    \u003cstrong\u003eutilities for filesystem operations\u003c/strong\u003e\n  \u003c/p\u003e\n\n  \u003cbr\u003e\n  \u003cdiv\u003e\n    \u003ca href=\"https://badge.fury.io/py/dirstuff\"\u003e\u003cimg src=\"https://badge.fury.io/py/dirstuff.svg\" alt=\"PyPI\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://pepy.tech/project/dirstuff\"\u003e\u003cimg src=\"https://pepy.tech/badge/dirstuff\" alt=\"Downloads\"\u003e\u003c/a\u003e\n  \u003c/div\u003e\n  \u003cbr\u003e\n\u003c/div\u003e\n\n## Installation\n\nInstall the current PyPI release:\n\n```bash\npip install dirstuff\n```\n\n## Path utilities\n\ndirstuff provides some Python utilities for interacting with the filesystem.\n\n- rename\n- move\n- copy\n- delete\n- walk\n\n### Rename files with a regex\n\nIn this example we iterate over nested folders that contain .txt files and rename them to have .md extensions.\n\n```python\nfrom dirstuff import Dir\n\nd = Dir(\"my_folder\")\nfor sub in d.iter_dirs():\n    for f in sub.iter_files():\n        f.rename_regex(r\"([a-z]*)\\.txt\", r\"\\1.md\")\n```\n\n### Delete a folder\n\nNo need to switch between `pathlib` and `shutil` packages. All filesystem utilities are available on the `Dir` class.\n\n```python\nfrom dirstuff import Dir\n\nd = Dir(\"my_folder\")\nd.delete()\n```\n\n## Summarization\n\n### Tree\n\nSummarize a directory recursively by file size. This tool can be used to quickly search a drive for large files taking up too much space.\n\n```bash\n# Summarize the /home/user/my_documents directory\n# showing only directories greater than 20MB in size\n$ dirstuff tree /home/user/my_documents --size 20MB\n```\n\n```python\n|-\u003e  69.0 GB \u003e my_documents\n    |-\u003e  67.8 GB \u003e movies\n        |-\u003e  62.0 GB \u003e from_the_internet\n        |-\u003e   5.8 GB \u003e home_movies\n    |-\u003e 638.1 MB \u003e photos\n        |-\u003e 368.2 MB \u003e rock_concert\n        |-\u003e 251.6 MB \u003e vacation_2019\n        |-\u003e  18.4 MB \u003e family_photos\n    |-\u003e 521.6 MB \u003e work\n        |-\u003e 263.8 MB \u003e boring_docs\n        |-\u003e 257.7 MB \u003e reports\n    |-\u003e  22.5 MB \u003e games\n```\n\n\u003e You can show the full absolute paths with `--absolute`\n\n### Search\n\nSearch for all folders with a matching name.\n\n```bash\n# List all node_modules folders under the /code/projects directory\n$ dirstuff search /code/projects node_modules --absolute\n```\n\n```python\n |-\u003e 419.6 MB \u003e /code/projects/portfolio/web/node_modules\n |-\u003e 320.3 MB \u003e /code/projects/fun_project/node_modules\n |-\u003e 298.1 MB \u003e /code/projects/simple_game/version_2/node_modules\n```\n\n\u003e The same `--size` option also works with the search command\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregorybchris%2Fdirstuff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgregorybchris%2Fdirstuff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregorybchris%2Fdirstuff/lists"}