Skip to main content
crapaud

🐸 LeCrapaud

An all-in-one machine learning framework

PyPI version Python versions Documentation


LeCrapaud is a high-level Python library for end-to-end machine learning on tabular and time series data. It handles feature engineering, model selection, training, and prediction in one command.

Key Features

  • 🔄 End-to-end ML pipeline — feature engineering, preprocessing, feature selection, hyperparameter optimization, and training in a single fit() call
  • 🤖 11+ models — from Linear Regression to XGBoost, LightGBM, CatBoost, and deep learning architectures (LSTM, GRU, TCN, Transformer)
  • 🎯 Automated feature selection — ensemble of 10+ methods (Chi2, ANOVA, Mutual Information, SHAP, RFE, etc.)
  • Hyperparameter optimization — HyperOpt (TPE) and Ray Tune with cross-validation support
  • 🔍 Explainability — built-in SHAP, LIME, feature importance, and tree visualization
  • 🗄️ Experiment tracking — every experiment is stored in the database (PostgreSQL or MySQL) with full reproducibility
  • 🧩 Modular — use the full pipeline or individual components (FeatureEngineer, FeaturePreprocessor, FeatureSelector) in sklearn-compatible pipelines

Why LeCrapaud?

Most ML tools solve one piece of the puzzle. LeCrapaud handles the entire workflow in a single fit() call.

LeCrapaud MLflow scikit-learn Auto-sklearn / TPOT
Feature engineering ✅ Automated (Fourier dates, target encoding, imputation) ❌ Manual ❌ Manual ❌ Generic only
Feature selection ✅ Ensemble of 10+ methods with voting ❌ Manual ❌ One method at a time ⚠️ Implicit
Hyperparameter optimization ✅ HyperOpt + Ray Tune ❌ Manual ⚠️ GridSearchCV ✅ Built-in
Multi-target support ✅ Native (regression + classification)
Deep learning models ✅ LSTM, GRU, TCN, Transformer ⚠️ MLP only
Time series support ✅ Fourier features, temporal CV, RNNs ⚠️ Basic
Explainability ✅ SHAP + LIME + feature importance ⚠️ Feature importance only
Experiment tracking ✅ Full artifacts in PostgreSQL/MySQL ✅ Tracking server
Reproducibility ✅ Reload any experiment with get(id=...) ⚠️
sklearn compatibility ✅ fit/transform pattern ✅ Native

In short:

  • MLflow tracks experiments but doesn't train models or engineer features — you still write all the ML code yourself
  • scikit-learn provides building blocks but requires manual pipeline composition, no experiment tracking, and limited model support
  • AutoML tools (auto-sklearn, TPOT) automate model selection but act as black boxes with no feature engineering transparency, no explainability, and no time series support
  • LeCrapaud combines automated feature engineering, ensemble feature selection, hyperparameter optimization, multi-target training, explainability, and experiment tracking — all in one fit() call, while remaining transparent and customizable

Prerequisites

  • Python 3.12 (strictly required)
  • PostgreSQL or MySQL database for experiment storage
  • macOS onlylibomp for LightGBM/XGBoost:
    brew install libomp
    

Installation

📦 From PyPI (recommended)

Install the latest stable release:

pip install lecrapaud

Or pin a specific version:

pip install lecrapaud==2.5.0

⚡ Optional extras

The base install ships scikit-learn, gradient boosting (CatBoost, XGBoost, LightGBM) and explainability (SHAP, LIME) — enough to train, tune and explain a model with nothing else. Two heavy feature sets are opt-in:

Extra Install What it adds
deep pip install 'lecrapaud[deep]' TabNet, FT-Transformer and the 11 recurrent/transformer architectures (PyTorch + Lightning)
hpo pip install 'lecrapaud[hpo]' The Ray Tune optimisation backend (LECRAPAUD_OPTIMIZATION_BACKEND=ray). The default backend, HyperOpt, is core
all pip install 'lecrapaud[all]' Both

Requesting a model or backend whose extra is missing raises an error naming exactly what to install — nothing fails silently or at import time.

🗄️ Database

LeCrapaud persists experiments, models and artifacts to a database. Point it at one with DB_URI (PostgreSQL or MySQL), or DB_USER/DB_PASSWORD/DB_HOST/ DB_PORT/DB_NAME.

With no configuration at all, it falls back to a local SQLite store at ~/.lecrapaud/lecrapaud.db so you can try it out immediately, and says so on startup. Move that store to a real database whenever you are ready:

from lecrapaud.db import export_to
export_to("postgresql://user:pass@host:5432/lecrapaud")

The fallback triggers only when no database variable is set at all — a partial or wrong configuration still fails loudly, so a broken deploy is never silently redirected to a local file. Set LECRAPAUD_NO_SQLITE_FALLBACK=1 to disable it entirely.

🔧 From source

Install the latest development version directly from GitHub:

pip install git+https://github.com/PierreGallet/lecrapaud.git

Or clone the repository and install locally:

git clone https://github.com/PierreGallet/lecrapaud.git
cd lecrapaud
pip install .

Quick Start

from lecrapaud import LeCrapaud

LeCrapaud.set_uri("mysql+pymysql://user:password@host:port/dbname")

lc = LeCrapaud(
    experiment_name="my_experiment",
    target_numbers=[1],
    target_clf=[1],
    models_idx=["lgb", "xgb"],
)

lc.fit(data)
predictions = lc.predict(new_data)
# eval scores (when new_data has TARGET columns): lc.regression_scores / lc.classification_scores

Documentation

Full documentation available at lecrapaud.pierregallet.com

Contributing

Contributions are welcome! Here's how to get started.

Development Setup

git clone https://github.com/PierreGallet/lecrapaud.git
cd lecrapaud
python3.12 -m venv .venv
source .venv/bin/activate
make install

Development tooling lives in PEP 735 dependency groups, not in the runtime dependencies — so pip install lecrapaud never pulls a linter, a test runner or a doc builder:

Group Contents Install
dev black, flake8, pylint, mypy, bandit, safety, poetry, pipdeptree default
test pytest, pytest-cov, pytest-mock, coverage default
docs mkdocs + material, mkdocstrings, gen-files, literate-nav, section-index uv sync --group docs
notebook ipykernel, ipywidgets uv sync --group notebook

A bare uv sync gives you dev + test. Add a runtime dependency in requirements.in; add tooling in the matching requirements-<group>.in, and make install routes it to the right place.

Workflow

  1. Open an issue first to discuss the change you'd like to make
  2. Fork the repo and create a branch from main:
    • feat/your-feature for new features
    • fix/your-bugfix for bug fixes
    • docs/your-change for documentation
  3. Write or update tests when changing behavior
  4. Run the test suite before submitting:
    make test
    
  5. Open a Pull Request against main with a clear description

Commit Convention

We use Conventional Commits. Every commit message and PR title must follow this format:

type: short description
Type Usage
feat: New feature
fix: Bug fix
docs: Documentation only
refactor: Code change that neither fixes a bug nor adds a feature
test: Adding or updating tests
perf: Performance improvement
ci: CI/CD changes
chore: Maintenance tasks

Examples:

feat: add catboost model support
fix: handle missing target column in predict
docs: update getting started guide

Guidelines

  • Keep PRs focused and small — one concern per PR
  • Update documentation when APIs change
  • Follow the existing code style
  • All tests must pass before merging

License

LeCrapaud is licensed under the Apache License 2.0. You are free to use, modify, and distribute this software in compliance with the license terms.


Pierre Gallet 2025

Bases locales (Docker)

Prérequis : Docker (Desktop ou OrbStack). Rien d'autre — ni serveur ni client Homebrew. Les cibles Make exécutent les clients (psql, createdb, mysql…) dans les conteneurs, qui les embarquent déjà.

Une seule commande : make db-up. Elle s'adapte à ce qui tourne déjà.

Situation Ce qu'elle fait
rien n'écoute sur 3306 démarre le conteneur de ce dépôt, puis crée les bases
un serveur répond déjà sur 3306 n'y touche pas, y ajoute les bases manquantes

Le second cas couvre aussi bien un MySQL personnel préexistant qu'un serveur mutualisé entre plusieurs dépôts. Relancer la commande ne détruit jamais de données : les créations sont idempotentes.

docker-compose.dev.yml déclare un seul serveur MySQL hébergeant les deux bases, et non deux conteneurs comme précédemment. Serveur en utf8mb4 / utf8mb4_unicode_ci.

Cible Effet
make db-up prépare les bases, quel que soit ce qui tourne déjà
make db-down arrête le conteneur de ce dépôt (sans effet s'il n'en a pas créé)

make test-db-setup dépend de db-up : rien à démarrer à la main avant les tests.

Ports et bases

Service Port Bases
mysql 3306 lecrapaud_dev · lecrapaud_test

Le port standard, et non un port décalé : le script détecte un serveur existant au lieu d'essayer de l'éviter. Les deux bases vivent dans le même serveur, donc une seule connexion suffit dans un client graphique.

Le conteneur n'écoute que sur 127.0.0.1, jamais 0.0.0.0.

Utilise 127.0.0.1, jamais localhost : le client MySQL traite localhost comme une socket Unix et ignore le port.

Viser une base distante

Toutes les variables restent surchargeables : renseigner les endpoints dans .env suffit à pointer une base distante, sans toucher au Makefile.

Download files

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

Source Distribution

lecrapaud-2.10.1.tar.gz (303.9 kB view details)

Uploaded Source

Built Distribution

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

lecrapaud-2.10.1-py3-none-any.whl (359.8 kB view details)

Uploaded Python 3

File details

Details for the file lecrapaud-2.10.1.tar.gz.

File metadata

  • Download URL: lecrapaud-2.10.1.tar.gz
  • Upload date:
  • Size: 303.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.14

File hashes

Hashes for lecrapaud-2.10.1.tar.gz
Algorithm Hash digest
SHA256 3a35d38a71c729c9489dad8f953fe39ea7e3e25aa18c541aa1ebb399a7686762
MD5 ea4227dd468e8d4654e180b9f30e7e7c
BLAKE2b-256 29051d406ea200077dca55579eb3368132386496a35355f1f8d84fea10e7c6ea

See more details on using hashes here.

File details

Details for the file lecrapaud-2.10.1-py3-none-any.whl.

File metadata

  • Download URL: lecrapaud-2.10.1-py3-none-any.whl
  • Upload date:
  • Size: 359.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.14

File hashes

Hashes for lecrapaud-2.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c60c52e6a3d222e827bd0e5a34ad1204ed33273fc65338b3186b5251bbe7b666
MD5 d106ad7adfad99a5ffc35b7811f5b3c2
BLAKE2b-256 09a557d7c3a0f6a1a91d9093adabafe05890614a0a897e9ac28e133b2f1638ed

See more details on using hashes here.

Release history Release notifications | RSS feed

2.14.0

2 files

2.13.0

2 files

2.12.0

2 files

2.11.0

2 files

2.10.2

2 files

This release

2.10.1 This release

2 files

2.10.0

2 files

2.9.0

2 files

2.8.0

2 files

2.7.0

2 files

2.6.2

2 files

2.6.1

2 files

2.6.0

2 files

2.5.0

2 files

2.4.15

2 files

2.4.14

2 files

2.4.13

2 files

2.4.12

2 files

2.4.11

2 files

2.4.10

2 files

2.4.9

2 files

2.4.8

2 files

2.4.7

2 files

2.4.6

2 files

2.4.5

2 files

2.4.4

2 files

2.4.3

2 files

2.4.2

2 files

2.4.1

2 files

2.4.0

2 files

2.3.7

2 files

2.3.6

2 files

2.3.5

2 files

2.3.4

2 files

2.3.3

2 files

2.3.2

2 files

2.3.1

2 files

2.3.0

2 files

2.2.0

2 files

2.1.1

2 files

2.1.0

2 files

2.0.0

2 files

1.4.0

2 files

1.3.1

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.38.0

2 files

0.37.0

2 files

0.36.1

2 files

0.36.0

2 files

0.35.0

2 files

0.34.0

2 files

0.33.1

2 files

0.33.0

2 files

0.32.2

2 files

0.32.1

2 files

0.32.0

2 files

0.31.9

2 files

0.31.8

2 files

0.31.7

2 files

0.31.6

2 files

0.31.5

2 files

0.31.4

2 files

0.31.3

2 files

0.31.2

2 files

0.31.1

2 files

0.31.0

2 files

0.30.0

2 files

0.29.0

2 files

0.28.0

2 files

0.27.30

2 files

0.27.29

2 files

0.27.28

2 files

0.27.27

2 files

0.27.26

2 files

0.27.25

2 files

0.27.24

2 files

0.27.23

2 files

0.27.22

2 files

0.27.21

2 files

0.27.20

2 files

0.27.19

2 files

0.27.18

2 files

0.27.17

2 files

0.27.16

2 files

0.27.15

2 files

0.27.14

2 files

0.27.13

2 files

0.27.12

2 files

0.27.11

2 files

0.27.10

2 files

0.27.9

2 files

0.27.8

2 files

0.27.7

2 files

0.27.6

2 files

0.27.4

2 files

0.27.3

2 files

0.27.2

2 files

0.27.1

2 files

0.27.0

2 files

0.26.0

2 files

0.25.2

2 files

0.25.1

2 files

0.25.0

2 files

0.24.5

2 files

0.24.4

2 files

0.24.3

2 files

0.24.2

2 files

0.24.1

2 files

0.24.0

2 files

0.23.3

2 files

0.23.2

2 files

0.23.1

2 files

0.23.0

2 files

0.22.6

2 files

0.22.5

2 files

0.22.4

2 files

0.22.3

2 files

0.22.2

2 files

0.22.1

2 files

0.22.0

2 files

0.21.2

2 files

0.21.1

2 files

0.21.0

2 files

0.20.2

2 files

0.20.1

2 files

0.20.0

2 files

0.19.3

2 files

0.19.2

2 files

0.19.1

2 files

0.19.0

2 files

0.18.10

2 files

0.18.9

2 files

0.18.8

2 files

0.18.7

2 files

0.18.6

2 files

0.18.5

2 files

0.18.4

2 files

0.18.3

2 files

0.18.2

2 files

0.18.1

2 files

0.18.0

2 files

0.17.0

2 files

0.16.7

2 files

0.16.6

2 files

0.16.5

2 files

0.16.4

2 files

0.16.3

2 files

0.16.2

2 files

0.16.1

2 files

0.16.0

2 files

0.15.0

2 files

0.14.8

2 files

0.14.7

2 files

0.14.6

2 files

0.14.5

2 files

0.14.4

2 files

0.14.3

2 files

0.14.2

2 files

0.14.1

2 files

0.14.0

2 files

0.13.1

2 files

0.13.0

2 files

0.12.2

2 files

0.12.1

2 files

0.12.0

2 files

0.11.6

2 files

0.11.5

2 files

0.11.4

2 files

0.11.3

2 files

0.11.2

2 files

0.11.1

2 files

0.11.0

2 files

0.10.2

2 files

0.10.1

2 files

0.10.0

2 files

0.9.4

2 files

0.9.3

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

0.8.4

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

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