A pipe-first language for data and ML work, running on top of Python
Project description
Peppermint
A pipe-first language for data and ML work, running on top of Python. Every operation is a pipeline step and errors propagate automatically. The Python ecosystem (pandas, scikit-learn, or your own code) is accessible from within the language.
Install
pip install peppermint-lang
pip install peppermint-lang[ml] # + scikit-learn, umap, openai
pip install peppermint-lang[lsp] # + language server
pip install peppermint-lang[all] # everything
Or from source:
git clone https://github.com/chayapatr/peppermint
cd peppermint
pip install -e ".[all]"
Run
pep file.pep # run a file
pep # interactive REPL
pep lsp # start language server (stdio)
Examples
load("employees.csv")
|> filter(it.age > 18)
|> add(tax: it.salary * 0.2)
|> sort(by: "salary", dir: "desc")
|> print()
Each step prints a live summary:
|> filter → List 843 rows × 5 cols (157 dropped)
|> add → List 843 rows × 6 cols (+tax)
|> sort → List 843 rows × 6 cols
use ml
use viz
use env
load("data.csv")
|> add(embedding: ml.embed(it.text,
source: "deepinfra", model: "Qwen/Qwen3-Embedding-4B",
apikey: env.DEEPINFRA_TOKEN))
@concurrent(10)
|> ml.kmeans(k: 2..8, on: "embedding", out: "cluster")
|> ml.umap(dims: 2, on: "embedding", out: "umap")
|> viz.scatter(x: "umap_1", y: "umap_2", color: "cluster", display: { label: "text", legend })
Aggregate
load("sales.csv")
|> collapse(by: "region",
avg: mean(col.revenue),
n: count()
)
|> sort(by: "avg", dir: "desc")
|> print()
Top N per group
load("sales.csv")
|> each(by: "region",
|> add(rank: rank(col.revenue, dir: "desc"))
|> filter(it.rank <= 3)
|> drop("rank")
)
|> print()
Error handling
result = load("data.csv")
|> filter(it.score > 0.5)
match(result,
Ok(data): data |> print(),
Err(msg): print(msg)
)
Python bridge
use "./transforms.py" as t
load("data.csv")
|> t.clean()
|> print()
Python functions receive and return plain Python types. Conversion is automatic.
Editor support
The LSP server (pep lsp) provides diagnostics, hover docs, completions, and go-to-definition for any LSP-capable editor.
VSCode — install the extension from ecosystem/vscode-peppermint/. It auto-discovers pep via mise, pyenv, or Homebrew — no PATH setup needed.
Neovim:
vim.lsp.start({ name = "peppermint", cmd = { "pep", "lsp" }, root_dir = vim.fn.getcwd() })
Helix (~/.config/helix/languages.toml):
[language-server.peppermint-lsp]
command = "pep"
args = ["lsp"]
See docs/language.md for the language reference, docs/stdlib.md for all stdlib functions, and docs/ecosystem.md for full editor setup.
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 peppermint_lang-0.4.0a1.tar.gz.
File metadata
- Download URL: peppermint_lang-0.4.0a1.tar.gz
- Upload date:
- Size: 57.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00ef09fe58f4928267cbf89348b9aa0e527520554f462b97accc1a94f520b90f
|
|
| MD5 |
0d503983a360fb8759e67b0b304d9c5c
|
|
| BLAKE2b-256 |
3e23f7715e0c528ae762aad36b504dda0536500669ac50b11890608990351b5e
|
Provenance
The following attestation bundles were made for peppermint_lang-0.4.0a1.tar.gz:
Publisher:
workflow.yml on chayapatr/peppermint
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
peppermint_lang-0.4.0a1.tar.gz -
Subject digest:
00ef09fe58f4928267cbf89348b9aa0e527520554f462b97accc1a94f520b90f - Sigstore transparency entry: 1664518148
- Sigstore integration time:
-
Permalink:
chayapatr/peppermint@c24f51091717ab9661e717590821bbeab7127867 -
Branch / Tag:
refs/tags/v0.4.0a1 - Owner: https://github.com/chayapatr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@c24f51091717ab9661e717590821bbeab7127867 -
Trigger Event:
push
-
Statement type:
File details
Details for the file peppermint_lang-0.4.0a1-py3-none-any.whl.
File metadata
- Download URL: peppermint_lang-0.4.0a1-py3-none-any.whl
- Upload date:
- Size: 49.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fa544b6b8928ed7311566e8575ab3946959a23106d888debdd9e3b68895641f
|
|
| MD5 |
531947a7565437e289222f00dfa2e23f
|
|
| BLAKE2b-256 |
ae787dab84508e4c8d3cd16b41e7f03e10fe367669437797e499cb5f069d3fc0
|
Provenance
The following attestation bundles were made for peppermint_lang-0.4.0a1-py3-none-any.whl:
Publisher:
workflow.yml on chayapatr/peppermint
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
peppermint_lang-0.4.0a1-py3-none-any.whl -
Subject digest:
0fa544b6b8928ed7311566e8575ab3946959a23106d888debdd9e3b68895641f - Sigstore transparency entry: 1664518239
- Sigstore integration time:
-
Permalink:
chayapatr/peppermint@c24f51091717ab9661e717590821bbeab7127867 -
Branch / Tag:
refs/tags/v0.4.0a1 - Owner: https://github.com/chayapatr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@c24f51091717ab9661e717590821bbeab7127867 -
Trigger Event:
push
-
Statement type: