Safe os.remove alternative with soft delete to .trash/ folder
Project description
py-trashguard
A safe alternative to os.remove() that moves files to a .trash/ folder instead of deleting them permanently. Usable as both a Python API and a CLI tool.
Features
- Soft-delete files (move to
.trash/) - Restore files from trash
- List trashed files
- No third-party dependencies (stdlib only)
Installation
pip install .
Usage
Python API
from pytrashguard import trash, restore, list_trash
trash("myfile.txt")
print(list_trash())
restore("myfile.txt")
CLI
py-trashguard --trash myfile.txt
py-trashguard --list
py-trashguard --restore myfile.txt
Project Structure
pytrashguard/core.py: Core logicpytrashguard/cli.py: CLI entry pointpytrashguard/__init__.py: API exposurepyproject.toml: PackagingREADME.md: Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
py_trashguard-0.1.0.tar.gz
(3.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_trashguard-0.1.0.tar.gz.
File metadata
- Download URL: py_trashguard-0.1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd7c066b13d36ba0e2eb283bfcc96771f7f739aa1ecce7c8a72b5a2e29a648bc
|
|
| MD5 |
73f2f6ce28890c8af7ee336cc24f1a81
|
|
| BLAKE2b-256 |
db3754d181daf5b3bbd189c73c995ee8309e7bd3a973a4874787ad5ad93f70b6
|
File details
Details for the file py_trashguard-0.1.0-py3-none-any.whl.
File metadata
- Download URL: py_trashguard-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
024059b8379524a87851d9beabff5fa164f0092b6c144ffeb61dd86e49a7c291
|
|
| MD5 |
be31749cb2d2c8dce07f4e29edb5e3e1
|
|
| BLAKE2b-256 |
51d769c73d6b778d1a62f24bf8753bc8fff2e376c0e5e6427abd3a2192acc04f
|