Metadata-Version: 2.4
Name: lilya_converter
Version: 0.2.0
Summary: Convert your existing projects into a Lilya application with ease
Project-URL: Homepage, https://github.com/dymmond/lilya-converter
Project-URL: Documentation, https://lilya-converter.dymmond.com
Project-URL: Changelog, https://lilya-converter.dymmond.com/release-notes/
Project-URL: Funding, https://github.com/sponsors/tarsil
Project-URL: Source, https://github.com/dymmond/lilya-converter
Author-email: Tiago Silva <tiago.silva@dymmond.com>
License-Expression: MIT
License-File: LICENSE
Keywords: lilya_converter
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: AnyIO
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: lilya[standard]
Requires-Dist: sayer
Provides-Extra: django
Requires-Dist: django>=6.0.3; extra == 'django'
Provides-Extra: fastapi
Requires-Dist: fastapi[standard]>=0.135.0; extra == 'fastapi'
Provides-Extra: flask
Requires-Dist: flask>=3.1.3; extra == 'flask'
Provides-Extra: litestar
Requires-Dist: litestar>=2.21.0; extra == 'litestar'
Provides-Extra: starlette
Requires-Dist: starlette>=0.52.0; extra == 'starlette'
Provides-Extra: testing
Requires-Dist: autoflake<3.0.0,>=2.0.2; extra == 'testing'
Requires-Dist: black<25.0,==24.1.1; extra == 'testing'
Requires-Dist: isort<6.0.0,>=5.12.0; extra == 'testing'
Requires-Dist: pytest-cov<5.0.0,>=4.0.0; extra == 'testing'
Requires-Dist: pytest<9.0.0,>=7.2.2; extra == 'testing'
Requires-Dist: zensical<0.1.0,>=0.0.23; extra == 'testing'
Description-Content-Type: text/markdown

# Lilya Converter

<p align="center">
  <a href="https://lilya.dev"><img src="https://res.cloudinary.com/dymmond/image/upload/v1707501404/lilya/logo_quiotd.png" alt='Lilya'></a>
</p>

<p align="center">
    <em>Convert web framework codebases into Lilya with deterministic rules, explicit diagnostics, and reproducible reports.</em>
</p>

<p align="center">
<a href="https://github.com/dymmond/lilya-converter/actions/workflows/test-suite.yml/badge.svg?event=push&branch=main" target="_blank">
    <img src="https://github.com/dymmond/lilya-converter/actions/workflows/test-suite.yml/badge.svg?event=push&branch=main" alt="Test Suite">
</a>

<a href="https://pypi.org/project/lilya-converter" target="_blank">
    <img src="https://img.shields.io/pypi/v/lilya-converter?color=2334D058&label=pypi%20package" alt="Package version">
</a>

<a href="https://pypi.org/project/lilya-converter" target="_blank">
    <img src="https://img.shields.io/pypi/pyversions/lilya-converter.svg?color=2334D058" alt="Supported Python versions">
</a>
</p>

---

**Documentation**: [https://lilya-converter.dymmond.com](https://lilya-converter.dymmond.com) 📚

**Source Code**: [https://github.com/dymmond/lilya-converter](https://github.com/dymmond/lilya-converter) 💻

---

`lilya_converter` is a modular CLI for converting source framework projects into Lilya.

## Supported Sources

| Source | Key | Notes |
| --- | --- | --- |
| FastAPI | `fastapi` | Default source, backwards-compatible behavior |
| Flask | `flask` | Blueprint and route conversion |
| Django | `django` | URLConf conversion + management command path remap |
| Litestar | `litestar` | Decorator/route_handlers conversion |
| Starlette | `starlette` | Route/Mount conversion |

## Architecture

- framework-agnostic core orchestration,
- explicit adapter registry,
- framework-specific adapters,
- shared filesystem utilities,
- deterministic report and diagnostic models.

## Installation

```bash
pip install lilya-converter
```

Optional framework extras (useful when you also want local framework packages installed):

```bash
pip install "lilya-converter[fastapi]"
pip install "lilya-converter[flask]"
pip install "lilya-converter[django]"
pip install "lilya-converter[litestar]"
pip install "lilya-converter[starlette]"
```

Install with all supported framework extras:

```bash
pip install "lilya-converter[fastapi,flask,django,litestar,starlette]"
```

For local development:

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

CLI entrypoint:

```bash
lilya-converter --help
```

## Usage

FastAPI remains the default source:

```bash
lilya-converter analyze ./my-fastapi-app
lilya-converter convert ./my-fastapi-app ./my-lilya-app --dry-run --diff
```

Select another framework explicitly:

```bash
lilya-converter analyze ./my-django-app --source django
lilya-converter convert ./my-flask-app ./my-lilya-app --source flask
lilya-converter convert ./my-litestar-app ./my-lilya-app --source litestar
lilya-converter convert ./my-starlette-app ./my-lilya-app --source starlette
lilya-converter verify ./my-lilya-app --source django --report ./reports/verify.json
```

Full source-key matrix:

```bash
lilya-converter convert ./my-fastapi-app ./my-lilya-app
lilya-converter convert ./my-flask-app ./my-lilya-app --source flask
lilya-converter convert ./my-django-app ./my-lilya-app --source django
lilya-converter convert ./my-litestar-app ./my-lilya-app --source litestar
lilya-converter convert ./my-starlette-app ./my-lilya-app --source starlette
```

## Commands

```bash
lilya-converter analyze SOURCE [--source SOURCE_KEY] [--json] [--output REPORT.json]
lilya-converter convert SOURCE TARGET [--source SOURCE_KEY] [--dry-run] [--diff] [--report REPORT.json]
lilya-converter scaffold SOURCE TARGET [--source SOURCE_KEY] [--dry-run]
lilya-converter map rules [--source SOURCE_KEY]
lilya-converter map applied REPORT.json
lilya-converter verify TARGET [--source SOURCE_KEY] [--report REPORT.json]
```

Run `lilya-converter convert --help` to see supported source keys in deterministic order.

## Adapter Extension Guide

See [Adding a New Adapter](docs/en/docs/adding-adapter.md) for:

- adapter package skeleton,
- explicit registry registration,
- test expectations,
- typing, docstring, and error-handling conventions.

## Testing

Run full test suite:

```bash
hatch run test:test -q
```

## Building docs

```bash
hatch run docs:build
```
