Metadata-Version: 2.4
Name: lens-lang
Version: 0.1.0
Summary: Language for Exploratory & Narrative Statistics - A declarative analytics language
Author: Anay Biswas
License-Expression: Apache-2.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Database :: Front-Ends
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: lark>=1.1.9
Requires-Dist: duckdb>=0.9.2
Requires-Dist: pandas>=2.1.4
Requires-Dist: altair>=5.2.0
Requires-Dist: rich>=13.7.0
Provides-Extra: studio
Requires-Dist: streamlit>=1.30.0; extra == "studio"
Dynamic: license-file

# 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

```bash
pip install lens-lang
```

Or install from source:
```bash
git clone https://github.com/Anay007-git/lens.git
cd lens
pip install -e .
```

## Quick Start

### CLI
```bash
python cli/lens_cli.py -q "show net_sales by region for FY2025"
```

### Studio (No-Code UI)
```bash
python -m streamlit run studio/app.py
```

### Python API
```python
from lens.compiler.parser import LensParser

parser = LensParser()
ast = parser.parse("show net_sales by region for FY2025")
print(ast)
```

## Example Query

```lens
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*
