Metadata-Version: 2.4
Name: gridient
Version: 0.1.0
Summary: A Python library for writing calculations to Excel while preserving formulas.
Home-page: https://github.com/yourusername/gridient
Author: Your Name
Author-email: your.email@example.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: xlsxwriter
Requires-Dist: pandas
Requires-Dist: numpy-financial
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Gridient

A Python library designed to simplify writing complex calculations and data structures to Excel files while preserving the underlying formulas. Define your logic in Python using familiar operators and let Gridient translate it into live Excel formulas.

## Features

- Define calculations using Python operators (+, -, *, /).
- Write Pandas DataFrames and Series.
- Create parameter tables.
- Apply cell styling (bold, italics, colors, etc.).
- Use custom number formatting.
- Organize output across multiple sheets using a layout system.
- Best-effort column auto-width adjustment.

## Installation

```bash
pip install -r requirements.txt
pip install .
```

## Basic Usage (Conceptual)

```python
import gridient as gr
import pandas as pd

# Define values and parameters
initial_investment = gr.ExcelValue("Initial Investment", 1000000, format="$#,##0")
discount_rate = gr.ExcelValue("Discount Rate", 0.05, format="0.00%")
params = gr.ExcelParameterTable("Parameters", [initial_investment, discount_rate])

# Perform calculations (these become Excel formulas)
revenue = gr.ExcelSeries.from_pandas(pd.Series([100, 150, 200]), name="Revenue")
profit = revenue * 0.2
profit.name = "Profit"
profit.format = "$#,##0"

# Create layout
workbook = gr.ExcelWorkbook("report.xlsx")
layout = gr.ExcelLayout(workbook)
sheet1 = gr.ExcelSheetLayout("Dashboard")

# Add components to layout
sheet1.add(params, row=1, col=1)
sheet1.add(profit, row=5, col=1)

# Add sheet to workbook layout and write
layout.add_sheet(sheet1)
layout.write() 
``` 
