{"id":51840984,"url":"https://github.com/nspc911/pytrash","last_synced_at":"2026-07-23T05:02:46.240Z","repository":{"id":370805062,"uuid":"1295501440","full_name":"NSPC911/pytrash","owner":"NSPC911","description":"high level api for recycling","archived":false,"fork":false,"pushed_at":"2026-07-19T00:57:33.000Z","size":127,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-19T02:28:33.959Z","etag":null,"topics":["python","recyclebin","trash"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/trashy","language":"Python","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/NSPC911.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2026-07-09T15:50:30.000Z","updated_at":"2026-07-19T00:57:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/NSPC911/pytrash","commit_stats":null,"previous_names":["nspc911/trashy"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/NSPC911/pytrash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSPC911%2Fpytrash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSPC911%2Fpytrash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSPC911%2Fpytrash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSPC911%2Fpytrash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NSPC911","download_url":"https://codeload.github.com/NSPC911/pytrash/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSPC911%2Fpytrash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35789247,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-23T02:00:06.683Z","response_time":57,"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":["python","recyclebin","trash"],"created_at":"2026-07-23T05:02:45.503Z","updated_at":"2026-07-23T05:02:46.233Z","avatar_url":"https://github.com/NSPC911.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pytrash\n\na high level api for handling recycle bins across platforms\n\n### Installation\n```\nuv add pytrash\n```\n\n### Usage\n```py\nimport pytrash\n\n# pytrash provides a way to move files to the bin, list entries in bin, and restore files from bin.\n# create instance of Bin\nbin = pytrash.RecycleBin()\n\n# move a file to the bin\nbin.recycle([\"path/to/file.txt\"])\n\n# list entries\nbin.entries()\n\n# restore a file from the bin\nentry = bin.entries()[0]\nbin.restore([entry])\n\n# permanently delete a file from the bin (irreversible!)\nbin.purge([entry])\n\n# permanently delete everything in the bin (irreversible!)\nbin.empty()\n```\n\nThat's it. It doesn't get any simpler than that.\n\nEntries are returned as a list of `TrashEntry` dataclasses, which contain the following attributes:\n\n```py\nTrashEntry(\n  name='Screenshot from 2026-06-10 17-35-55.png',\n  original_path='/home/nspc911/Pictures/Screenshots/Screenshot from 2026-06-10 17-35-55.png',  # this will be None if entry doesn't contain this info\n  deleted_at=datetime.datetime(2026, 6, 28, 11, 31, 17),  # this can be None if entry doesn't contain this info\n  size=13075  # shouldn't be None, but it is possible.\n)\n```\n\nFor now, only the major 3 OSes are supported (Windows, Linux, MacOS). If you want to add support for your OS, feel free to open a PR.\n\n### CLI\nThis also includes a CLI for interacting with the recycle bin\n```\nuv tool install pytrash\n```\n\n```\npytrash trash \u003cfile1\u003e \u003cfile2\u003e ...  # move files to the bin\npytrash list                       # list entries in the bin\npytrash list --json                # list entries in the bin\npytrash restore \u003centry1\u003e \u003centry2\u003e ...  # restore entries from the bin\npytrash purge \u003centry1\u003e \u003centry2\u003e ...    # permanently delete entries (asks first; -y to skip)\npytrash empty                          # permanently delete everything (asks first; -y to skip)\n```\n\nThis CLI interface is not to be compared with the [`trashy`](https://github.com/oberblastmeister/trashy) CLI, it is Rust, it doesn't have the Python Interpreter overhead. This project aims to provide an easy interface for cross platform bins. The CLI is simply a way to make use of it.\n\n### Like what I do? Check out similar projects\n- [multiarchive](https://github.com/NSPC911/multiarchive): a high level api for handling archives across formats\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnspc911%2Fpytrash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnspc911%2Fpytrash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnspc911%2Fpytrash/lists"}