Skip to main content

An AI-driven domain-specific language engine for automated data cleaning pipelines.

Project description

PuraLang Engine ๐Ÿš€

An AI-powered Domain-Specific Language for automated data cleaning pipelines.
Describe your data problem in plain English โ€” PuraLang writes and runs the pipeline for you.


What is PuraLang?

PuraLang is a custom programming language built specifically for data cleaning. Instead of writing 30โ€“50 lines of Python/Pandas code every time you need to clean a dataset, you write a clean, human-readable .pura script โ€” or better yet, just describe what you want in English and let the AI generate the script for you.

The Problem It Solves

Every data engineer and ML practitioner spends hours writing repetitive boilerplate code like this:

import pandas as pd
df = pd.read_csv("users.csv")
df = df.drop_duplicates(subset=["user_id"])
df["age"] = df["age"].fillna(24)
df["email"] = df["email"].str.strip().str.lower()
df.to_csv("clean_users.csv", index=False)

With PuraLang, the same result is achieved in 5 readable lines:

LOAD "users.csv"
  |> DROP_DUPLICATES "user_id"
  |> FILL_NULLS "age" VALUE 24
  |> FORMAT_STRINGS "email" TO LOWERCASE
  |> EXPORT_CSV "clean_users.csv"

And with AI Mode, you don't even need to write that:

puralang ask "clean users.csv โ€” remove duplicate user IDs, fill missing ages with 24, lowercase all emails"

Features

  • Custom DSL Syntax โ€” Clean, readable pipeline syntax with |> operators
  • AI Mode โ€” Describe your cleaning task in plain English; the engine generates and runs the script automatically
  • Visual Execution Trace โ€” Beautiful terminal output showing row counts before and after every operation
  • Multiple Operations โ€” DROP_DUPLICATES, FILL_NULLS, FORMAT_STRINGS, FILTER_ROWS, EXPORT_CSV
  • Zero Boilerplate โ€” No Pandas knowledge required to use it

Installation

pip install puralang-engine

Or clone and run locally:

git clone https://github.com/SaiDarsini/puralang_engine.git
cd puralang_engine
pip install -r requirements.txt

Quick Start

Manual Mode โ€” Write a .pura script

Create a file called pipeline.pura:

LOAD "dirty_data.csv"
  |> DROP_DUPLICATES "user_id"
  |> FILL_NULLS "age" VALUE 24
  |> FORMAT_STRINGS "email" TO LOWERCASE
  |> EXPORT_CSV "cleaned_output.csv"

Run it:

puralang run pipeline.pura

AI Mode โ€” Describe it in English

puralang ask "load sales.csv, remove duplicate order IDs, fill missing prices with 0, export to clean_sales.csv"

PuraLang will:

  1. Send your description to an AI model
  2. Show you the generated .pura script
  3. Execute it automatically
  4. Print the trace report

Execution Output

Every pipeline run produces a visual trace table in your terminal:

 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ PuraLang Execution Trace โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
 โ”‚ Operation                      โ”‚ Rows Before โ”‚ Rows After โ”‚
 โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
 โ”‚ LOAD SOURCE DATA               โ”‚ -           โ”‚ 4          โ”‚
 โ”‚ DROP DUPLICATES [user_id]      โ”‚ 4           โ”‚ 3          โ”‚
 โ”‚ FILL NULL FIELDS [age]         โ”‚ 3           โ”‚ 3          โ”‚
 โ”‚ STRING TRANSFORM [email]       โ”‚ 3           โ”‚ 3          โ”‚
 โ”‚ EXPORT COMPILED FILE           โ”‚ 3           โ”‚ 3          โ”‚
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Supported Operations

Operation Syntax Description
Load CSV LOAD "file.csv" Load a CSV file into the pipeline
Drop Duplicates DROP_DUPLICATES "column" Remove duplicate rows based on a column
Fill Nulls FILL_NULLS "column" VALUE 0 Fill missing values with a default
Format Strings FORMAT_STRINGS "column" TO LOWERCASE Normalize text casing
Filter Rows FILTER_ROWS "column" GREATER_THAN 18 Filter rows by condition
Export CSV EXPORT_CSV "output.csv" Save cleaned data to a new file

Project Architecture

puralang_engine/
โ”‚
โ”œโ”€โ”€ puralang/
โ”‚   โ”œโ”€โ”€ __init__.py       # Package version
โ”‚   โ”œโ”€โ”€ core.py           # Lark grammar, parser, and transformer engine
โ”‚   โ””โ”€โ”€ cli.py            # Typer CLI โ€” run and ask commands
โ”‚
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ sample.pura       # Example PuraLang script
โ”‚
โ”œโ”€โ”€ setup.py              # PyPI packaging config
โ””โ”€โ”€ README.md

The engine works in 3 stages:

.pura script โ†’ [Lark Parser] โ†’ Abstract Syntax Tree โ†’ [Transformer] โ†’ Pandas execution โ†’ Clean CSV

For AI Mode:

English prompt โ†’ [LLM API] โ†’ .pura script โ†’ [Engine] โ†’ Clean CSV

Tech Stack

  • Lark โ€” Grammar definition and parsing
  • Pandas โ€” Underlying data manipulation engine
  • Rich โ€” Beautiful terminal output and trace tables
  • Typer โ€” CLI command interface
  • Google Gemini API โ€” AI script generation (AI Mode)

Roadmap

  • Core DSL parser and transformer
  • CLI with run command
  • AI Mode with ask command
  • Visual execution trace table
  • PyPI public release (pip install puralang-engine)
  • Support for JSON and Excel input formats
  • Web UI for non-technical users
  • VS Code extension with .pura syntax highlighting

About the Author

Sai Darsini Sathuluru
B.Tech Student | Mohan Babu University | Generative AI Intern @ Prodigy InfoTech
Founder & Core Architect of PuraLang Engine


License

This project is licensed under the MIT License โ€” you are free to use, modify, and distribute it.
See the LICENSE file for details.


Built with โค๏ธ by Sai Darsini ยท If this helped you, please โญ the repo!

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

puralang_engine-1.0.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

puralang_engine-1.0.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file puralang_engine-1.0.0.tar.gz.

File metadata

  • Download URL: puralang_engine-1.0.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for puralang_engine-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ff87d3c6b9e7f740e8ac6d983d75633a8934d44994c87e549b1453e77c0a5e36
MD5 ab9ce0a088d9bf948f17d63ae200348f
BLAKE2b-256 c166c4e70339ee1a12b065399ffe01e8c3a005c68083f4e974587863dec41ef2

See more details on using hashes here.

File details

Details for the file puralang_engine-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for puralang_engine-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6aabd4fa21520677007aa31904414984a25a083b25ced54d93ba11cc8149b6d3
MD5 d1235d613791f4937e4f6fcadff10493
BLAKE2b-256 0c4431d29e81edbdce2bfec2957f1b774331b900cde47e839fc2dd35ad98d220

See more details on using hashes here.

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