Language for Exploratory & Narrative Statistics - A declarative analytics language
Project description
LENS - Language for Exploratory & Narrative Statistics
LENS is an open-source analytics programming language that bridges the gap between business questions and data execution using natural language.
Features
- Declarative Syntax: English-like queries (
show net_sales by region) - Time Intelligence: Built-in FY, YTD, rolling dates
- Auto-Visualization: Generates best-fit charts (Vega-Lite)
- Story Engine: Produces narratives from data trends
- No-Code Studio: Streamlit-based visual interface
Installation
pip install lens-lang
Or install from source:
git clone https://github.com/Anay007-git/lens.git
cd lens
pip install -e .
Quick Start
CLI
python cli/lens_cli.py -q "show net_sales by region for FY2025"
Studio (No-Code UI)
python -m streamlit run studio/app.py
Python API
from lens.compiler.parser import LensParser
parser = LensParser()
ast = parser.parse("show net_sales by region for FY2025")
print(ast)
Example Query
show net_sales by region
for FY2025
compare with previous year
Output:
- SQL query
- Data table
- Auto-generated chart
- Business narrative
Architecture
lens/
├── compiler/ # Lark parser + AST
├── semantics/ # Metric/Dimension registry
├── time_intelligence/ # FY, YTD, relative dates
├── planner/ # Logical plan builder
├── sql_gen/ # DuckDB SQL generator
├── runtime/ # Query execution
├── visualization/ # Altair/Vega-Lite charts
└── story/ # Trend analysis + narratives
License
Apache 2.0
Author
Anay Biswas
Built with ❤️ for the analytics community
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 lens_lang-0.1.0.tar.gz.
File metadata
- Download URL: lens_lang-0.1.0.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0534ed8b4ac556c5d19a9f01720d1738899a76104bb8471a162d2225e0dee6e
|
|
| MD5 |
9e7487d43d109714024a67a5c935dfd0
|
|
| BLAKE2b-256 |
f39ac666c931f560d54816f5d8413dc5efab6a50a5b9270abd091367f05b0552
|
Provenance
The following attestation bundles were made for lens_lang-0.1.0.tar.gz:
Publisher:
publish.yml on Anay007-git/lens
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lens_lang-0.1.0.tar.gz -
Subject digest:
e0534ed8b4ac556c5d19a9f01720d1738899a76104bb8471a162d2225e0dee6e - Sigstore transparency entry: 911162131
- Sigstore integration time:
-
Permalink:
Anay007-git/lens@f6d16cb7338b5f9522ea197f3055166c4575c396 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Anay007-git
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f6d16cb7338b5f9522ea197f3055166c4575c396 -
Trigger Event:
release
-
Statement type:
File details
Details for the file lens_lang-0.1.0-py3-none-any.whl.
File metadata
- Download URL: lens_lang-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c332978094d0aec3653a4fc02b477714f4607ec77238cc000e87c6fb7ec3aefe
|
|
| MD5 |
f898cf8fd656e3560a5112aaa1e1b9ea
|
|
| BLAKE2b-256 |
67c5341ea2d70aca8f6484e26b1cdde16eae5242934dfba2995d66a0fc8dbbb7
|
Provenance
The following attestation bundles were made for lens_lang-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Anay007-git/lens
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lens_lang-0.1.0-py3-none-any.whl -
Subject digest:
c332978094d0aec3653a4fc02b477714f4607ec77238cc000e87c6fb7ec3aefe - Sigstore transparency entry: 911162154
- Sigstore integration time:
-
Permalink:
Anay007-git/lens@f6d16cb7338b5f9522ea197f3055166c4575c396 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Anay007-git
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f6d16cb7338b5f9522ea197f3055166c4575c396 -
Trigger Event:
release
-
Statement type: