Skip to main content

Eigrel

A programming language for Data, Machine Learning and AI.

CI PyPI License

Write what you want. Let the compiler decide how to run it.

Eigrel is a declarative language for data engineering, machine learning and GenAI. You describe datasets, transformations, features and models in one language; the compiler decides whether each step becomes Python, SQL, Spark or something else.

dataset customers from csv("data/customers.csv")

transform customers {
    filter age >= 18
    select age, income, purchases, churned
}

features customers {
    age
    income
    purchases
}

model churn = random_forest {
    trees = 100
}

train churn {
    target = churned
}

evaluate churn {
    metrics = [accuracy, precision, recall, f1]
}

Status

Eigrel is at v0.2 — Compiler: programs are checked for meaning, lowered into an intermediate representation and compiled to Python (pandas + scikit-learn), so eigrel run trains and evaluates real models. Next up: more data sources (v0.3). See the roadmap.

Getting started

Install from PyPI (Python 3.13+). The python extra adds pandas and scikit-learn, which eigrel run needs:

pip install "eigrel[python]"
eigrel init churn             # creates churn/main.eig and sample data
eigrel run churn/main.eig
churn: random_forest classification, trained on 315 rows, validated on 79
  accuracy   0.7975
  precision  0.7442
  recall     0.8649
  f1         0.8000

CLI

Command What it does
eigrel run FILE Compiles the program to Python and runs it
eigrel check FILE... Reports syntax and semantic errors with line and column
eigrel compile FILE [-o PATH] Prints (or writes) the generated Python code
eigrel ir FILE Prints the intermediate representation
eigrel ast FILE Prints the syntax tree as JSON
eigrel tokens FILE Prints the token stream
eigrel init NAME Creates a project with a starter program and sample data

The compiler catches mistakes before anything runs, and points at the exact spot:

error: column 'income' does not exist here; available columns: age, purchases, churned
 --> churn.eig:9:5
  |
9 |     income
  |     ^

How it works

source → lexer → parser → AST → semantic analysis → IR → Python backend → pandas + scikit-learn

eigrel ir shows the graph the backends work from:

%0 = load csv("data/customers.csv")  # customers
%1 = filter %0 (age >= 18)  # customers
%2 = select %1 [age, income, purchases, churned]  # customers
%3 = train %2 random_forest(trees=100, max_depth=8) classification features=[age, income, purchases] target=churned validation=0.2 seed=42  # churn
%4 = evaluate %3 [accuracy, precision, recall, f1]  # churn

Docker

make docker-build
make docker-run      # runs examples/ml.eig inside the container

Language

The full syntax is in docs/LANGUAGE.md. Examples live in examples/.

Contributing

Bug reports, language proposals and pull requests are welcome. Read the contributing guide to get set up, and note that this project follows a Code of Conduct. Security issues go through SECURITY.md.

License

Licensed under the Apache License 2.0.

Metadata

Release files for eigrel 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eigrel 0.2.0
File Size Uploaded
eigrel-0.2.0.tar.gz 33.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for eigrel 0.2.0
File Interpreter ABI Platform
eigrel-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 61.5 kB

Release files / eigrel-0.2.0.tar.gz

Download URL eigrel-0.2.0.tar.gz
Size 33.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b7d7bceb4229618b35c811fb9bdf177bcbdfad3861c4f70ec0c467b2c39c0ff6
BLAKE2b-256 checksum
How to use checksums
471291d9d18563a7be4ccaed8f1a542e3a1cdfe4dd714bae4732b6f282ea8ece
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release files / eigrel-0.2.0-py3-none-any.whl

Download URL eigrel-0.2.0-py3-none-any.whl
Size 27.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a13be670d69a1c95cff8e9e48fd3d509df16fe701565523f6b0d5819c687a690
BLAKE2b-256 checksum
How to use checksums
18eeeffcd928b3e05b465d807c638f986298422961508340b582e658900ebbc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release history Release notifications | RSS feed

1.0.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.0

2 release 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