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à.

docker-compose.dev.yml déclare deux conteneurs MySQL : un pour le dev (volume nommé, les données survivent à make db-down) et un pour les tests (sans volume, jetable). Serveur en utf8mb4 / utf8mb4_unicode_ci.

Cible Effet
make db-up démarre les conteneurs et attend les healthchecks
make db-down arrête (les données de dev sont conservées)

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

Ports

Ports décalés par rapport aux valeurs par défaut (5432 / 3306 / 6379), pour ne pas entrer en conflit avec un serveur déjà installé sur la machine.

Service Dev Test
mysql 3309 3310

Les conteneurs n'écoutent que sur 127.0.0.1, jamais 0.0.0.0.

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.6.2.tar.gz (266.5 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.6.2-py3-none-any.whl (314.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lecrapaud-2.6.2.tar.gz
  • Upload date:
  • Size: 266.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for lecrapaud-2.6.2.tar.gz
Algorithm Hash digest
SHA256 0ad834ee8a9e83611af827cf9f417e6d29d74cd7af022891887f7fe4a3ad9d28
MD5 0b87aec55c3ed0f87b30d53d335dfcb0
BLAKE2b-256 8065fe69feeac02c1c3e342ff6d086acaf02b58cb1ba0392d2f0bfd870352a9e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lecrapaud-2.6.2-py3-none-any.whl
  • Upload date:
  • Size: 314.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for lecrapaud-2.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b7549766afb1d890d4b2f04e1b439ef73ec552bdd77b3c4c4fff321d60780c42
MD5 463e5fc9a06c876829099244874dc556
BLAKE2b-256 508a850191492090bc84b41db1ca7036d3c28c5d32ed8898b7bfa4751d290c6c

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

2.10.1

2 files

2.10.0

2 files

2.9.0

2 files

2.8.0

2 files

2.7.0

2 files

This release

2.6.2 This release

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