Registry / ai-ml / skrub
library0.9.0pypypi✓ verified 90d ago

Skrub is a Python library for machine learning with dataframes, offering robust tools for cleaning, preprocessing, and encoding tabular data, particularly for heterogeneous or messy datasets. It provides scikit-learn compatible transformers and a powerful DataOps API for complex data pipelines. The current version is 0.8.0, with regular minor and patch releases.

pip install skrub
INSTALL
IMPORT
SIG · SKRUB
S
skrub
ai-mlpythonv0.9.0
Install
18.3s avg
Import
8496ms
Disk
451MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.9.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.920 runs
build_error
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 18.3s · import 8.496s · 434MB
451MB installed
● package 451MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GapEncoder
✓ from skrub import GapEncoder
TableVectorizer
✓ from skrub import TableVectorizer
StringEncoder
✓ from skrub import StringEncoder
DataOps
✓ from skrub import DataOps
✗ from skrub.dataops import DataOps
DataOps was promoted to top-level import in 0.6.0. The old path still works but top-level is preferred.
MinHashEncoder
✓ from skrub import MinHashEncoder

This quickstart demonstrates how to use `skrub.TableVectorizer` within a scikit-learn pipeline to automatically preprocess a DataFrame containing mixed data types (here, messy categorical text) and then train a logistic regression model. `TableVectorizer` intelligently applies appropriate encoders to different column types.

import pandas as pd from sklearn.linear_model import LogisticRegression from sklearn.model_selection import train_test_split from sklearn.pipeline import Pipeline from skrub import TableVectorizer # Sample DataFrame with messy categorical data df = pd.DataFrame({ 'city': ['Paris', 'london', 'New-York', 'paris', 'tokyo', 'new york'], 'country': ['France', 'United Kingdom', 'USA', 'France', 'Japan', 'United States'], 'price': [100, 150, 200, 110, 180, 210] }) X = df[['city', 'country']] y = (df['price'] > 150).astype(int) # Binary target X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=42) # Create a scikit-learn pipeline with TableVectorizer pipeline = Pipeline([ ('table_vectorizer', TableVectorizer(low_memory=True)), # Automatically handles different column types ('classifier', LogisticRegression(random_state=42)) ]) # Fit and evaluate the pipeline pipeline.fit(X_train, y_train) score = pipeline.score(X_test, y_test) print(f"Pipeline score: {score:.2f}")
Debug
Known issues
breakingThe `ApplyToCols` and `ApplyToFrame` transformers have been removed in version 0.8.0. Their functionality is now intended to be covered by other methods or a simplified `ApplyToCols` (if a new one was introduced under a different path).
fix
Remove imports and usages of `ApplyToCols` and `ApplyToFrame`. Consult the skrub 0.8.0 documentation for alternative strategies for column-wise transformations.
affects: >=0.8.0
breakingMinimum Python version increased to 3.10 in skrub 0.7.0. Installing or running on older Python environments will fail.
fix
Ensure your Python environment is 3.10 or newer. Upgrade Python using your preferred package manager (e.g., `conda install python=3.10` or `pyenv install 3.10.12`).
affects: >=0.7.0
breakingMinimum versions for key dependencies `scikit-learn` (>=1.4.2), `requests` (>=2.27.1) were increased in 0.7.0. Additionally, the minimum `polars` version (optional dependency) increased to >=1.5 in 0.8.0.
fix
Upgrade your `scikit-learn`, `requests`, and `polars` (if used) installations to meet the new minimum requirements: `pip install -U scikit-learn requests 'polars>=1.5'`.
affects: >=0.7.0, >=0.8.0 (for polars)
deprecatedKen embeddings (`skrub.KenEmbeddings`) were deprecated in skrub 0.6.2 and will be removed in a future version. Usage will emit a `DeprecationWarning`.
fix
Migrate away from `KenEmbeddings` to other available encoders provided by skrub, such as `GapEncoder` or `TableVectorizer`, which offer similar or enhanced functionality.
affects: >=0.6.2
gotchaThe `compute_ngram_distance` utility function was made private (`_compute_ngram_distance`) in 0.7.2 to reduce API clutter and indicate it's not part of the public API.
fix
If you were directly using `compute_ngram_distance`, switch to its private counterpart `_compute_ngram_distance`. Be aware that private functions may change without notice.
affects: >=0.7.2
Errors
Common errors & fixes
ImportError: cannot import name 'ApplyToCols' from 'skrub'
The `ApplyToCols` transformer class was removed in skrub version 0.8.0.
fix
Update your code to remove imports of `ApplyToCols` and refactor the transformation logic using other `skrub` transformers or direct pandas operations, as the old class no longer exists.
DeprecationWarning: Ken embeddings are deprecated and will be removed in a future version.
Your code is using `skrub.KenEmbeddings`, which has been deprecated since skrub 0.6.2.
fix
Replace `KenEmbeddings` with alternative encoders like `GapEncoder` or `TableVectorizer`. For example, `GapEncoder` often provides similar or better performance.
Your Python version is 3.9.x, but skrub >=0.7.0 requires Python >= 3.10. Please upgrade your Python version.
Skrub versions 0.7.0 and later enforce a minimum Python version of 3.10.
fix
Upgrade your Python environment to version 3.10 or newer. Check `python --version` and install a newer version if needed.
AttributeError: 'DropCols' object has no attribute 'columns_'
Attribute names for `DropCols` and `SelectCols` instances were renamed in 0.7.1 for consistency (e.g., `columns_` might have been renamed to `cols_to_drop_` or `cols_to_select_`).
fix
Review the skrub 0.7.1 release notes or current documentation for `DropCols` and `SelectCols` to identify the correct attribute names. For example, `drop_cols_` and `select_cols_` are common patterns.
Upgrade
Version history
0.9.0latest on PyPI · released May 6, 2026
Audit
Dependencies
scikit-learnrequiredCore dependency for transformers and pipelines, requires >=1.4.2 since 0.7.0.
requestsrequiredUsed for some data fetching utilities, requires >=2.27.1 since 0.7.0.
polarsoptionalOptional dependency for enhanced performance/features in DataOps, requires >=1.5 since 0.8.0.
optunaoptionalOptional dependency for tuning DataOps pipelines.
Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
skrub — pip install skrub · libregistry