Skip to main content

A lightweight Python tool to silence and simplify noisy ML logs globally or temporarily.

Project description

๐Ÿง˜โ€โ™‚๏ธ QuietML โ€” Make Machine Learning Logs Calm & Clean

QuietML is a lightweight Python library that helps you silence, simplify, and structure noisy logs from ML frameworks like LightGBM, XGBoost, CatBoost, and TensorFlow โ€” in just one line.

Whether you're a student tired of endless [Info] spam or a developer who likes clean notebooks, QuietML keeps your console peaceful and professional.


๐ŸŒŸ Why QuietML?

If youโ€™ve ever seen this ๐Ÿ‘‡


[LightGBM] [Info] Number of positive: 4178, number of negative: 4178
[LightGBM] [Info] Auto-choosing row-wise multi-threading...
[LightGBM] [Warning] No further splits with positive gain, best gain: -inf

You know how painful it is to find your real output among hundreds of logs.

โœ… QuietML fixes that instantly โ€” clean outputs, no spam, one line of code.


โš™๏ธ Installation

pip install quietml

or if you want the latest build directly from source:

pip install --upgrade --no-cache-dir quietml

๐Ÿš€ Quick Start

๐Ÿงฉ Simplest Way โ€” One-Line Setup

from quietml import configure
import lightgbm as lgb
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split

X, y = load_breast_cancer(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)

# Configure QuietML and model in one go
model = configure(lgb.LGBMClassifier(), mode="smart")
model.fit(X_train, y_train)

๐Ÿง  Output:

[QuietML] Global mode set to: SMART
[LightGBM] [Warning] No further splits with positive gain, best gain: -inf
โœ… Model training complete!

๐ŸŽ›๏ธ Manual Control (Multiple Frameworks)

from quietml import set_mode, apply_to_model
import xgboost as xgb

set_mode("silent")  # or "smart" / "debug"
model = apply_to_model(xgb.XGBClassifier())
model.fit(X_train, y_train)

๐Ÿง  Output (silent mode):

[QuietML] Global mode set to: SILENT
โœ… Model training complete!

๐Ÿ”‡ Temporary Silence Mode

from quietml import silence
import lightgbm as lgb

model = lgb.LGBMClassifier()

print("Training normally...")
model.fit(X_train, y_train)

with silence("silent"):
    print("Training silently...")
    model.fit(X_train, y_train)

print("Logs restored.")

๐Ÿง  Output:

Training normally...
[LightGBM] [Info] ...
Training silently...
โœ… (no logs)
Logs restored.

๐Ÿง  Available Modes

Mode Description What You See
๐Ÿ’ค silent Suppresses all logs Only warnings/errors
๐Ÿค– smart Keeps essential info, hides spam Warnings + important info
๐Ÿงฉ debug Shows everything Full developer logs

๐Ÿงฑ Supported Frameworks

Library Supported Controlled Parameter
LightGBM โœ… verbosity
XGBoost โœ… verbosity
CatBoost โœ… logging_level
TensorFlow โœ… TF_CPP_MIN_LOG_LEVEL
Scikit-learn ๐Ÿ”ธ (indirectly) via wrapped models
PyTorch ๐Ÿ”œ (planned) โ€”
Transformers / LLMs ๐Ÿ”œ (planned) โ€”

๐Ÿงฉ API Reference

Function Purpose
set_mode(mode) Set global mode (silent, smart, or debug)
get_mode() Get current global mode
apply_to_model(model) Apply current mode to a model
configure(model, mode) Set mode + apply to a model in one call
silence(mode) Temporarily change mode using a with block

๐Ÿงช Example Output Comparison

Before QuietML:

[LightGBM] [Info] Number of positive: 4178, number of negative: 4178
[LightGBM] [Info] Auto-choosing row-wise multi-threading...
[LightGBM] [Warning] No further splits with positive gain...

After QuietML (smart mode):

[LightGBM] [Warning] No further splits with positive gain...
โœ… Training complete.

After QuietML (silent mode):

โœ… Training complete.

๐Ÿ“‚ Project Structure

quietml/
โ”‚
โ”œโ”€โ”€ quietml/
โ”‚   โ”œโ”€โ”€ __init__.py          # public API exports
โ”‚   โ”œโ”€โ”€ core.py              # main logic (modes, apply, silence)
โ”‚
โ”œโ”€โ”€ examples/
โ”‚   โ””โ”€โ”€ test_suppress.py     # demo file
โ”‚
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ LICENSE
โ””โ”€โ”€ .gitignore

๐Ÿง‘โ€๐Ÿ’ป Contributing

Want to improve QuietML? Weโ€™re open to contributions!

Ideas you can work on:

  • Add PyTorch or Transformers (LLMs) support
  • Add custom mode configurations
  • Add auto-detection of ML frameworks

How to contribute:

git clone https://github.com/<your-username>/quietml.git
cd quietml
pip install -e .

๐Ÿงก Author

๐Ÿ‘จโ€๐Ÿ’ป Kaustubh Aggarwal Computer Science Engineer, VIT Vellore Passionate about building cleaner, smarter, and more user-friendly ML tools.


๐Ÿ“œ License

This project is licensed under the MIT License โ€” free for personal and commercial use.


โœจ TL;DR for Users

You want to... Use this
Clean all logs instantly set_mode("silent")
Keep only key info set_mode("smart")
Debug your model deeply set_mode("debug")
Simplify everything model = configure(model, "smart")
Silence logs temporarily with silence("silent"):

๐Ÿง˜โ€โ™‚๏ธ QuietML โ€” Because your console deserves peace.

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

quietml-2.1.0.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

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

quietml-2.1.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file quietml-2.1.0.tar.gz.

File metadata

  • Download URL: quietml-2.1.0.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for quietml-2.1.0.tar.gz
Algorithm Hash digest
SHA256 041e1dbdd553ea2e17ee81ef66c1ca915bba072dcce74154da33b656d2e28a74
MD5 aface66a365fa4dfa25194a4adb79490
BLAKE2b-256 4da025efde0b8817417f8d8981dd1f96880e3601596568330478ec5fdf9864d6

See more details on using hashes here.

File details

Details for the file quietml-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: quietml-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for quietml-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ddc065261bd4a78d262ab366029c22835e625de857bcf1b7b15c993e59efe676
MD5 a10c7f5675cdc1d11ce829690f5c9435
BLAKE2b-256 9660b5b647480600a6b4acce995bb5a88ea535ce86ca5a180e28d8f7ed6043d3

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