Skip to main content

🧹 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

Metadata

Release files for log-file-cleaner-bijena 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for log-file-cleaner-bijena 0.1.1
File Size Uploaded Provenance Actions
log_file_cleaner_bijena-0.1.1.tar.gz 3.1 kB Without provenance Details for log_file_cleaner_bijena-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for log-file-cleaner-bijena 0.1.1
File Interpreter ABI Platform Actions
log_file_cleaner_bijena-0.1.1-py3-none-any.whl Python 3 none any Details for log_file_cleaner_bijena-0.1.1-py3-none-any.whl

Total release size: 7.1 kB

Release files / log_file_cleaner_bijena-0.1.1.tar.gz

Download URL log_file_cleaner_bijena-0.1.1.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a2374d8c08f884f134fee29cd44c159a845f66be7737b9387f803600d5676fce
BLAKE2b-256 checksum
How to use checksums
bc49e310042396ae249d085f308de4a807de0cfbfb70bf655f2bec8da25299dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / log_file_cleaner_bijena-0.1.1-py3-none-any.whl

Download URL log_file_cleaner_bijena-0.1.1-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a4dc714516b67ef6cf916d0a8cbdc84cc3647dc4fc0d47b615f19c2ed6d909a
BLAKE2b-256 checksum
How to use checksums
f1ae55cbb4d5be2a42a96bd81783cf22d2d28c153dc60f064b013867053c67b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for log-file-cleaner-bijena 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page