Skip to main content

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 (.log only)
  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

log_file_cleaner_bijena-0.1.1.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

log_file_cleaner_bijena-0.1.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

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

Hashes for log_file_cleaner_bijena-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a2374d8c08f884f134fee29cd44c159a845f66be7737b9387f803600d5676fce
MD5 83324c82544421839294fabf2377ecd1
BLAKE2b-256 bc49e310042396ae249d085f308de4a807de0cfbfb70bf655f2bec8da25299dd

See more details on using hashes here.

File details

Details for the file log_file_cleaner_bijena-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for log_file_cleaner_bijena-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7a4dc714516b67ef6cf916d0a8cbdc84cc3647dc4fc0d47b615f19c2ed6d909a
MD5 63263e5c82c39261d36cded3e4f77cd8
BLAKE2b-256 f1ae55cbb4d5be2a42a96bd81783cf22d2d28c153dc60f064b013867053c67b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page