Skip to main content

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

Run

pep file.pep  # run a file
pep           # interactive REPL

Examples

Transform

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

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()

ML pipeline

use ml
use viz
use env

load("data.csv")
  |> ml.embed(
      on: "text", out: "embedding",
      source: "deepinfra", model: "Qwen/Qwen3-Embedding-4B",
      apikey: env.get("DEEPINFRA_TOKEN"))
  |> ml.kmeans(k: 2..8, on: "embedding", out: "cluster")
  |> ml.umap(dims: 2, on: "embedding", out: "umap")
  |> viz.scatter(x: "umap1", y: "umap2", color: "cluster", label: "text", display: ["labels", "legend"])

Error handling

result = load("data.csv")
  |> filter(it.score > 0.5)

match(result,
  Ok(data): data |> print(),
  Err(msg):  print(msg)
)

See docs/language.md for the full reference and examples/ for more.

Project details


Download files

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

Source Distribution

peppermint_lang-0.3.2.tar.gz (40.2 kB view details)

Uploaded Source

Built Distribution

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

peppermint_lang-0.3.2-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

Details for the file peppermint_lang-0.3.2.tar.gz.

File metadata

  • Download URL: peppermint_lang-0.3.2.tar.gz
  • Upload date:
  • Size: 40.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for peppermint_lang-0.3.2.tar.gz
Algorithm Hash digest
SHA256 7db24c1d61d3fef9db09922f5b0a7a892aac7287ba8eb8db9b1d15c523232d64
MD5 761e3d0f2712ac07a4ce18549da81c5a
BLAKE2b-256 0af9b0f2a7e65ba143e1a83f426259538156d0f31b3bad7eb008881317e5aa27

See more details on using hashes here.

Provenance

The following attestation bundles were made for peppermint_lang-0.3.2.tar.gz:

Publisher: workflow.yml on chayapatr/peppermint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file peppermint_lang-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: peppermint_lang-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 37.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for peppermint_lang-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2839b84bd8b6e8e7a6a9f4502ef4c2421478788d10701af0f8ee82fd10fd4006
MD5 a98dcef06b88afe02bb0441e6a3ce04c
BLAKE2b-256 a30a1d9dd7c8669510d51a40e86bf4ccd8802c51e7c09638fa011f7d0a8f6243

See more details on using hashes here.

Provenance

The following attestation bundles were made for peppermint_lang-0.3.2-py3-none-any.whl:

Publisher: workflow.yml on chayapatr/peppermint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page