semvec/pypi-packages huggingface dataset:
nb4llm 0.1.3
Convert Jupyter notebooks to/from text format for LLM processing
License: MIT
Requires Python: >=3.8

# `nb4llm`

**Convert Jupyter notebooks to and from a readable, LLM-friendly text format.**

[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![CI](https://github.com/Amberlee2427/nb4llm/actions/workflows/ci.yml/badge.svg)](https://github.com/Amberlee2427/nb4llm/actions/workflows/ci.yml)


---

## 🚀 Features

- **Convert `.ipynb` → `.txt`**: Extracts markdown and code cells as readable, chunked blocks.
- **Convert `.txt` → `.ipynb`**: Reconstructs a notebook from the text format.
- **Language-aware**: Preserves code cell language (Python, R, Julia, etc).
- **Robust chunking**: Handles nested code fences and markdown.
- **CLI tool**: Easy to use from the command line or scripts.
- **Pre-commit, Black, isort, flake8**: Modern Python dev workflow.

---

## 📦 Installation

```bash
pip install -e .
# or, for development:
pip install -e .[dev]
```

---

## 📝 Usage

### **Convert a notebook to text**

```bash
nb4llm notebook.ipynb
# Output: notebook.txt
```

### **Convert a notebook to a specific text file**

```bash
nb4llm notebook.ipynb output.txt
```

### **Convert text back to a notebook**

```bash
nb4llm --reverse notebook.txt
# Output: notebook.ipynb
```

### **Convert text to a specific notebook file**

```bash
nb4llm --reverse notebook.txt output.ipynb
```

### **Show help**

```bash
nb4llm --help
```

---

## 🧑‍💻 Example Text Format

```
# my_notebook.ipynb

```markdown
Some markdown text
```

```python
# Some code
print(\"Hello, world!\")
```
```

---

## 🛠️ Development

### **Run tests**

```bash
pytest tests/
```

### **Run formatting and linting**

```bash
pre-commit run --all-files
```

### **Type checking**

```bash
mypy src/
```

---

## 🧩 Project Structure

```
nb4llm/
├── src/
│   └── nb4llm/
│       ├── __init__.py
│       ├── cli.py
│       └── converter.py
├── tests/
│   ├── test_cli.py
│   ├── test_converter.py
│   └── conftest.py
├── pyproject.toml
├── .pre-commit-config.yaml
├── .flake8
└── README.md
```

---

## 📝 Contributing

1. Fork the repo and create a feature branch.
2. Make your changes and add tests.
3. Run `pre-commit run --all-files` and `pytest`.
4. Submit a pull request!

---

## 📄 License

MIT License. See [LICENSE](LICENSE) for details.

---

**Built for robust, LLM-friendly notebook processing.**

---

Let me know if you want this written to your `README.md` or want to tweak any section!


## Contact

name: Amber Malpas 
github: AmberLee2427
email: malpas.1@osu.edu
sheet-simulator 0.1.1
A financial simulation engine integrated with Google Sheets
License: MIT
Requires Python: >=3.8

# Sheet Simulator 🧼📊

`sheet-simulator` es un paquete de Python que permite interactuar de forma programática con modelos financieros construidos en **Google Sheets**.

Permite:

- Modificar **inputs** directamente desde Python
- Leer los **outputs** calculados por el modelo
- Correr simulaciones (individuales o múltiples) de escenarios financieros
- Automatizar pruebas de sensibilidad y escenarios aleatorios

La lógica del modelo vive en Google Sheets. Python actúa como motor de simulación y visualización.

---

## ✨ Características

- Interfaz simple basada en la clase `SheetSimulator`
- Definición de inputs y outputs como mapeos de celdas/rangos
- Restauración automática de los valores originales tras cada simulación
- Generador de escenarios aleatorios o deterministas (`InputGenerator`)
- Soporte nativo para NumPy y operaciones vectoriales
- Diseñado para funcionar en Google Colab

---

## 🚀 Ejemplo rápido

```python
from sheet_simulator import SheetSimulator

# Conectarse a una hoja (autenticación interactiva en Colab)
url = "https://docs.google.com/spreadsheets/d/..."
sim = SheetSimulator.from_sheet_url(url)

# Definir inputs y outputs
sim.set_inputs([
    {"name": "growth_rate", "sheet": "Assumptions", "range": "B2"},
    {"name": "new_users", "sheet": "Inputs", "range": "C2:N2"},
])

sim.set_outputs([
    {"name": "net_income", "sheet": "P&L", "range": "B50"},
    {"name": "ARR", "sheet": "P&L", "range": "B51"},
])

# Leer valores actuales
current = sim.read_inputs()

# Simular un escenario
result = sim.run_simulation({"growth_rate": 0.15})

# Simular múltiples escenarios
scenarios = [{"growth_rate": r/100} for r in range(10, 21)]
results = sim.run_multiple_scenarios(scenarios)
```

---

## 🔬 Generación de escenarios

```python
from sheet_simulator import InputGenerator
import numpy as np

base = {"growth_rate": 0.1}
perturb = {
    "growth_rate": lambda v: InputGenerator.perturb_scalar(v, dist="normal", scale=0.02)
}

scenarios = InputGenerator.generate_scenarios(base, perturbations=perturb, n=100)
```

---

## 🔧 Instalación

```bash
pip install sheet-simulator
```

---

## 📎 Requisitos

- Python 3.8+
- `gspread`, `google-auth`, `google-api-python-client`, `numpy`
- Un Google Sheet compartido con permisos de edición

---

## 📄 Licencia

MIT License © 2024 — Created with ❤️ by David Corredor M (and ChattyChat)