A Python automation tool to clean old log files safely
Project description
🧹 Log File Cleaner
A simple Python automation tool to automatically delete old log files based on their last modified time.
It helps you keep your project folders clean by removing unnecessary .log files older than a specified number of days.
🚀 Features
- Delete log files older than N days
- Safe file filtering (
.logonly) - Dry-run mode (preview before deletion)
- Simple Python API
- Optional CLI support
- Lightweight and beginner-friendly
📦 Installation
From PyPI
pip install log-file-cleaner
🧠 Usage (Python API)
from log_file_cleaner import clean_logs
clean_logs(folder="logs", days=7)
📁 Project Structure
log-file-cleaner/
│
├── log_file_cleaner/
│ ├── __init__.py
│ ├── cleaner.py
│ └── cli.py
│
├── pyproject.toml
├── README.md
├── LICENSE
License
This project is licensed under the MIT License.
Author
Bijena Dhewaju - GitHub
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
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 log_file_cleaner_bijena-0.1.1.tar.gz.
File metadata
- Download URL: log_file_cleaner_bijena-0.1.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2374d8c08f884f134fee29cd44c159a845f66be7737b9387f803600d5676fce
|
|
| MD5 |
83324c82544421839294fabf2377ecd1
|
|
| BLAKE2b-256 |
bc49e310042396ae249d085f308de4a807de0cfbfb70bf655f2bec8da25299dd
|
File details
Details for the file log_file_cleaner_bijena-0.1.1-py3-none-any.whl.
File metadata
- Download URL: log_file_cleaner_bijena-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a4dc714516b67ef6cf916d0a8cbdc84cc3647dc4fc0d47b615f19c2ed6d909a
|
|
| MD5 |
63263e5c82c39261d36cded3e4f77cd8
|
|
| BLAKE2b-256 |
f1ae55cbb4d5be2a42a96bd81783cf22d2d28c153dc60f064b013867053c67b1
|