It allows you to verify if there are duplicated files in your file system. And, delete them if you want.
- Clone this project
git clone git@github.com:pepcmarques/deldup.git
- Go to the
deldupdirectory
cd deldup
- Install a Python virtualenv
python -m venv .venv
- Activate the
virtual environment
source .venv/bin/activate # For Linux or Mac
.venv\Scripts\activate # For Windows
- Install dependencies
pip install -r requirements.txt
- Run
DelDup
python deldup.py
The configuration file looks like the one below:
{
"port": 8000,
"home_dir": "/path/to/your/home/directory",
"database_url": "sqlite:///./deldup.sqlite3",
"mode": "none",
"categories": {
"images": {
"code": "img",
"ext": ["bmp", "gif", "jpg", "jpeg", "png", "tiff"]
},
"documents": {
"code": "doc",
"ext": ["doc", "docx", "odt", "ods", "ppt", "pptx", "pdf", "txt", "xls", "xlsx"]
}
}
}| Key | Description |
|---|---|
| home_dir | Directory from which you want to recursively check files. |
| database_url | url to connect to DB |
| mode | DelDup mode (explained below) |
| categories | JSON structure that defines which files will be checked for duplicates |
| Mode | Description |
|---|---|
| none | Remove file visually only |
| db | Remove file entry from DB. |
| fs | Remove file from the file system. |
| │ all | Remove file entry from DB and remove file from the file system |
The first time you run the project, it will create the configuration file and it will stops the execution.
The second time and you run the project, it will recursivelly check all the files and save entries in the database. This process takes a while.
After populating the DB, it will allow you to connect to it using your browser.
Open the browser and connect to http://0.0.0.0:8000 (on Mac) or http://127.0.0.1:8000 (on Linux and Windows). You can also use your machine IP address.
Note: The port must be the same as it is set in the configuration file.
In the project root, you will find the main program deldup.py, services.py, and settings.py. There are other 4 (four) directories where you will find the code app (containing the database engine and models), frontend (not much), backend (api), and static (css, images, and JS code).
I used Fastapi for the API and pure JavaScript to be able to run it anywhere. The beauty of it is that it allows you to generate one executable file with pyinstaller. So, it is not necessary to install anything, just run the executable.
I will prepare it asap for Mac, Linux, and Windows.
Python
- Create an issue
- Wait for this issue to be assigned to you
- Develop the feature and make a PR
