Sliq automatically fixes dataset schema issues, missing values, duplicate rows, and formatting errors so data professionals can get clean data in minutes, not hours or days.
Project description
Sliq Python Library
Data cleaning, made effortless.
Sliq is a Python library that provides a simple interface to clean your datasets using AI. With just a few lines of code, you can clean messy data, handle missing values, fix inconsistencies, and prepare your data for analysis or machine learning.
Installation
pip install sliq
Quick Start
Clean a file
import sliq
# Clean a CSV file and save the result
sliq.clean_from_file(
api_key="your-api-key",
dataset_path="path/to/your/data.csv",
dataset_name="My Dataset",
save_clean_file_path="path/to/output/",
)
Clean a DataFrame
import sliq
import pandas as pd
# Load your data
df = pd.read_csv("path/to/your/data.csv")
# Clean and get the result as a DataFrame
cleaned_df = sliq.clean_from_dataframe(
api_key="your-api-key",
dataframe=df,
dataset_name="My Dataset",
is_return_dataframe=True,
)
Features
- Simple API: Just two functions to clean any dataset
- Multiple formats: Supports CSV, JSON, JSONL, Excel, and Parquet files
- DataFrame support: Works with both Pandas and Polars DataFrames
- AI-powered: Uses advanced AI to understand and clean your data
- Customizable: Provide context about your data for better cleaning
- Secure: Your data is processed securely and deleted after cleaning
Supported File Formats
| Format | Extension |
|---|---|
| CSV | .csv |
| JSON | .json |
| JSONL | .jsonl |
| Excel | .xlsx, .xls |
| Parquet | .parquet |
API Reference
clean_from_file()
Clean a dataset from a file path.
sliq.clean_from_file(
api_key: str, # Required: Your Sliq API key
dataset_path: str, # Required: Path to your dataset file
dataset_name: str, # Required: Name for your dataset
save_clean_file_path: str = "", # Path to save the cleaned file
save_clean_file_name: str = "", # Custom name for the saved file
output_format: str | None = None, # Output file format (see below)
dataset_description: str = "", # Description of your data
dataset_purpose: str = "", # What the data will be used for
column_guide: dict[str, str] = None, # Column name to description mapping (see below)
data_source: str = "", # Where the data came from
user_instructions: str = "", # Special cleaning instructions
is_feature_engineering: bool = False, # Enable feature engineering
is_detailed_report: bool = False, # Generate detailed report
recipe_id: str | None = None, # Cleaning recipe ID (see below)
verbose: bool = False, # Show progress messages
)
clean_from_dataframe()
Clean a Pandas or Polars DataFrame.
cleaned_df = sliq.clean_from_dataframe(
api_key: str, # Required: Your Sliq API key
dataframe: pd.DataFrame | pl.DataFrame,# Required: Your DataFrame
dataset_name: str, # Required: Name for your dataset
output_format: str | None = None, # Output file format (see below)
dataset_description: str = "", # Description of your data
dataset_purpose: str = "", # What the data will be used for
column_guide: dict[str, str] = None, # Column name to description mapping (see below)
data_source: str = "", # Where the data came from
user_instructions: str = "", # Special cleaning instructions
is_feature_engineering: bool = False, # Enable feature engineering
is_detailed_report: bool = False, # Generate detailed report
recipe_id: str | None = None, # Cleaning recipe ID (see below)
is_return_dataframe: bool = True, # Return cleaned DataFrame
verbose: bool = False, # Show progress messages
)
Output Format
The output_format parameter controls the file format of the cleaned dataset:
- Valid formats:
.csv,.json,.jsonl,.xlsx,.parquet - Default behavior: If
output_formatisNoneor an empty string, the cleaned dataset is saved in the same format as the input file - The format string can be specified with or without the leading dot (e.g., both
"csv"and".csv"are valid)
Example:
# Save cleaned dataset as Parquet regardless of input format
sliq.clean_from_file(
api_key="your-api-key",
dataset_path="data/raw.csv",
dataset_name="My Dataset",
output_format=".parquet",
save_clean_file_path="data/cleaned/",
)
Column Guide Validation
When providing a column_guide, the following rules apply:
- All columns required: You must provide descriptions for all columns in your dataset
- Column count must match: The number of keys in
column_guidemust equal the number of columns in your dataset - Names must match: Column names are validated against the dataset (case-insensitive, underscore-insensitive)
Example:
# For a dataset with columns: "first_name", "last_name", "Age"
column_guide = {
"first_name": "Customer's first name",
"last_name": "Customer's last name",
"age": "Customer's age in years", # Case-insensitive: "age" matches "Age"
}
If column names don't match, you'll get a helpful error message listing the mismatched columns and the actual dataset columns.
Recipe-Driven Cleaning
You can apply a saved cleaning recipe to your dataset by providing a recipe_id. Recipes are pre-configured cleaning instructions created through the Sliq web application that define column-level rules, global cleaning standards, and schema transformations.
Find your Recipe ID at sliqdata.com/dashboard/recipes.
# Apply a saved recipe to a new dataset
sliq.clean_from_file(
api_key="your-api-key",
dataset_path="data/raw_sales.csv",
dataset_name="Sales Data Q4",
recipe_id="r-6hchd6160aj3c77c4c",
save_clean_file_path="data/cleaned/",
)
When a recipe_id is provided:
- The cleaning pipeline fetches the recipe from the Sliq platform
- Column descriptions embedded in the recipe are merged into the column guide
- Recipe rules guide the AI cleaning agents for consistent, reproducible results
Note: You can still provide column_guide, user_instructions, and other parameters alongside a recipe. User-provided column descriptions take precedence over recipe-derived descriptions.
Getting an API Key
To use Sliq, you need an API key. Visit sliqdata.com to get your API key.
Documentation
For full documentation, visit sliqdata.com/docs.
License
MIT License - see LICENSE for details.
For developers of the library
To install Sliq locally for development
pip install -e "Sliq-python-lib"
Publishing to PyPI
To upload a new version of Sliq-python-lib to PyPI:
-
Check your files:
- Ensure
pyproject.tomlandREADME.mdare present and correct. - Source code should be in
src/sliq/. - License and metadata should be set.
- Ensure
-
Build the distribution: In your project root (
Sliq-python-lib), run:python -m build
(If you don’t have
build, install it:pip install build) -
Check the distribution: Optionally, check for errors:
twine check dist/*
-
Upload to PyPI: Make sure you have a PyPI account and
twineinstalled (pip install twine). Then run:twine upload dist/*
If you get an error, check the message and resolve it, or ask for help.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sliq-0.2.0.tar.gz.
File metadata
- Download URL: sliq-0.2.0.tar.gz
- Upload date:
- Size: 28.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86773e68d58601f7919b05c174e91ce5886c19f73aad6b37e717762543b4414b
|
|
| MD5 |
9540b1c4f4d1c4ce3fa03c57d27fe3e9
|
|
| BLAKE2b-256 |
f8382bb4e123cc27c8b54800489fecc1cf361f1e7ab111dc53048531aaae56f7
|
File details
Details for the file sliq-0.2.0-py3-none-any.whl.
File metadata
- Download URL: sliq-0.2.0-py3-none-any.whl
- Upload date:
- Size: 24.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2392c9d87bdf931b7629a93c5ad1d5db7e95215ae3f8b84d7f330ce5b8e5210d
|
|
| MD5 |
e78a367b0b0aa2a9c6bff02464d05397
|
|
| BLAKE2b-256 |
6eeaa3a9b7008a08a23350a2e2b3312e95167185f9fe4345f48ad1fb980d80a3
|