Metadata-Version: 2.4
Name: ranno
Version: 0.4.0
Summary: Instant code generation & execution from prompts.
Author: Saptarshi Roy
License-Expression: MIT
Project-URL: Repository, https://github.com/saptarshiroy39/ranno
Project-URL: Homepage, https://pypi.org/project/ranno
Project-URL: Documentation, https://github.com/saptarshiroy39/ranno#readme
Project-URL: Bug Tracker, https://github.com/saptarshiroy39/ranno/issues
Keywords: ai,code-generation,execution,gemini,sdk,agent,safe-execution
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests
Requires-Dist: magika
Requires-Dist: pandas

---
title: Ranno
emoji: 🦖
colorFrom: gray
colorTo: yellow
sdk: docker
pinned: false
app_port: 7860
short_description: Python Library
---

<h1 align="center">
  <img src="https://raw.githubusercontent.com/saptarshiroy39/Ranno/refs/heads/main/lib/public/Ranno.svg" alt="🦖" width="128">
  <br>
  <b>Ranno</b>
</h1>

<p align="center">
  <a href="https://pypi.org/project/ranno"><b>Ranno</b></a> is a lightweight Python Library that converts prompts into fully-functional Python scripts, scans dataset columns automatically, and runs code safely with automated rollback file protection.
</p>

<p align="center">
  <a href="https://pypi.org/project/ranno"><b>🔗 <code>PyPI Package</code></b></a>
  &nbsp;|&nbsp;
  🆔 <code>pip install ranno</code> or <code>uv add ranno</code>
</p>

---

## 🐍 _SDK_

`Installation`

```bash
pip install ranno
# or
uv add ranno
```

`Generate Code (No Execution)`

```python
from ranno import gn

# Without Data
print(gn("Create a list of 10 dinosaurs"))

# With Data
print(gn("Find the average price", data="data.csv"))
```

`Execute Code Instantly (Auto-Backup)`

```python
from ranno import ex

# Without Data
ex("Print hello world 5 times")

# With Data
ex("Plot price vs category", data="data.csv")
```

`Save Code to File (Write to Disk)`

```python
from ranno import gn, sv

# Generate code
code = gn("Download image from URL")

# Save it to a file
sv(code, name="file.py")
```

`Custom Configuration (API & Model)`

```python
from ranno import cf, gn, ex

# Set custom credentials & model (Gemini only)
my_cfg = cf(api_key="api_key", model="model_name")

# Run with custom config
print(gn("Plot Sine Wave", config=my_cfg))

# Execute with custom config
ex("Plot correlation", data="data.csv", config=my_cfg)
```

---

## ✨ _Features_

| FEATURE                       | DESCRIPTION                                                               |
| ----------------------------- | ------------------------------------------------------------------------- |
| 🧠 **AI Code Generation**     | Turns plain English prompts into full, runnable Python scripts            |
| 📁 **AI File Intelligence**   | Detects file types (CSV, Excel, JSON) accurately, even without extensions |
| 🔍 **Auto Schema Extraction** | Reads columns and first 5 rows to build perfect AI context automatically  |
| 🧪 **Instant Execution**      | Runs AI-generated Python code directly with automated error handling      |
| ⚙️ **Custom Configuration**   | Override default API keys and Models per request using `cf()`             |
| 🛡️ **Shadow Copy Integrity**  | Creates a hidden `copy.` snapshot before execution; restores on failure   |
| 🦖 **Ultra Minimalism**       | Four functions (`gn`, `ex`, `sv`, `cf`) is all you need - zero boilerplate |

---

## 🏗️ _System Architecture_

| #   | COMPONENT     | DESCRIPTION                                            | STACK                                     |
| --- | ------------- | ------------------------------------------------------ | ----------------------------------------- |
| 1️⃣  | **Ranno SDK** | The client-side library handling data prep & execution | **_Python_**, **_Magika_**, **_Pandas_**  |
| 2️⃣  | **Ranno API** | Serverless backend for secure code generation          | **_FastAPI_**, **_Vercel_**, **_Gemini_** |

---

<p align="center">
  Made with 🦖 by <a href="https://hirishi.in">Saptarshi Roy</a>
</p>
