Metadata-Version: 2.4
Name: rastion
Version: 0.1.0
Summary: Local-first portable optimization problems and solver plugins
Author: rastion contributors
License: Apache-2.0
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27
Requires-Dist: numpy>=1.24
Requires-Dist: pydantic>=2.6
Requires-Dist: pyyaml>=6.0
Provides-Extra: all
Requires-Dist: dwave-neal>=0.6; extra == 'all'
Requires-Dist: highspy>=1.7; extra == 'all'
Requires-Dist: ortools>=9.10; extra == 'all'
Requires-Dist: pyscipopt>=5.0; extra == 'all'
Requires-Dist: pytest>=8.0; extra == 'all'
Requires-Dist: qiskit-algorithms>=0.3; extra == 'all'
Requires-Dist: qiskit>=0.45; extra == 'all'
Requires-Dist: readchar>=4.0; extra == 'all'
Requires-Dist: rich>=13.0; extra == 'all'
Requires-Dist: ruff>=0.6; extra == 'all'
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Provides-Extra: highs
Requires-Dist: highspy>=1.7; extra == 'highs'
Provides-Extra: neal
Requires-Dist: dwave-neal>=0.6; extra == 'neal'
Provides-Extra: ortools
Requires-Dist: ortools>=9.10; extra == 'ortools'
Provides-Extra: qaoa
Requires-Dist: qiskit-algorithms>=0.3; extra == 'qaoa'
Requires-Dist: qiskit>=0.45; extra == 'qaoa'
Provides-Extra: qiskit
Requires-Dist: qiskit-algorithms>=0.3; extra == 'qiskit'
Requires-Dist: qiskit>=0.45; extra == 'qiskit'
Provides-Extra: scip
Requires-Dist: pyscipopt>=5.0; extra == 'scip'
Provides-Extra: tui
Requires-Dist: readchar>=4.0; extra == 'tui'
Requires-Dist: rich>=13.0; extra == 'tui'
Description-Content-Type: text/markdown

# 🧪 Rastion - Your Personal Optimization Lab

A local-first optimization library for portable models and pluggable solvers.
Think Hugging Face for optimization workflows: package problems, swap solvers, benchmark results, and keep run history.

## Why Rastion?

- 🔌 **Plug & Play**: Switch solvers without rewriting problems.
- 📦 **Portable Problems**: Keep model, instances, metadata, and cards together.
- 🚀 **Quantum-Ready**: QUBO and QAOA support included.
- 📊 **Benchmark + History**: Compare solvers and keep reproducible run records.
- 🖥️ **TUI First**: Interactive lab experience with keyboard navigation.

## Installation

Core install:

```bash
pip install -e .
```

TUI install:

```bash
pip install -e ".[tui]"
```

All optional solver extras:

```bash
pip install -e ".[all]"
```

## Launch the Lab

```bash
rastion
```

Main actions:

- 📂 Browse Problems
- ⚙️ Browse Solvers
- ▶️ Solve a Problem
- 📊 Compare Solvers
- 📜 View Run History
- 📦 Export Problem
- 📥 Install Solver (from GitHub URL)

## Built-in Problems

| Problem | Type | Description |
| --- | --- | --- |
| knapsack | MILP | Classic 0-1 knapsack |
| maxcut | QUBO | MaxCut on graph |
| portfolio | QP | Mean-variance portfolio |
| facility_location | MILP | Facility location |
| set_cover | MILP | Set covering |
| tsp | MILP | Traveling salesman |

## Built-in Solvers

| Solver | Type | Best For |
| --- | --- | --- |
| baseline | exact/heuristic | Binary MILP, testing |
| highs | MILP/QP | Fast MILP and QP |
| ortools | MILP | Google's MILP stack |
| scip | MILP | Academic/advanced MILP |
| neal | QUBO | Simulated annealing |
| qaoa | QUBO | Quantum-style QAOA sampling |

## Sharing Solvers

Anyone can create and share a solver plugin.

1. Create a GitHub repo containing `solver.py` at repo root.
2. Share your ZIP URL.
3. Install with:

```bash
rastion install-solver https://github.com/YOU/repo/archive/main.zip
```

Template files:

- `rastion/solvers/solver_template.py`
- `rastion/solvers/solver_card_template.md`

## CLI Commands

- `rastion` (launch TUI)
- `rastion info [--verbose]`
- `rastion validate <spec> <instance>`
- `rastion solve <spec_or_problem> <instance>`
- `rastion benchmark <problem>`
- `rastion install <problem_folder>`
- `rastion export <problem> <destination>`
- `rastion install-solver <zip_url>`

## Documentation

- [Creating Problems](docs/CREATING_PROBLEMS.md)
- [Creating Solvers](docs/CREATING_SOLVERS.md)

## License

Apache-2.0
