Metadata-Version: 2.5
Name: sanka-migrate
Version: 0.1.0a4
Summary: Sanka — inspect, plan, execute, and verify migrations across applications and data systems
Project-URL: Repository, https://github.com/sankaHQ/sanka
Project-URL: Issues, https://github.com/sankaHQ/sanka/issues
Author: Sanka, Inc.
License-Expression: AGPL-3.0-only AND Apache-2.0
License-File: LICENSE
License-File: LICENSE-APACHE
License-File: NOTICE
Keywords: cli,data,etl,migration,sanka
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: clickhouse-connect>=0.8
Requires-Dist: fastapi<1,>=0.115
Requires-Dist: httpx<1,>=0.27
Requires-Dist: psycopg[binary]>=3.2
Requires-Dist: pyyaml>=6
Description-Content-Type: text/markdown

# Sanka

The [Sanka](https://github.com/sankaHQ/sanka) Runtime: the migration
lifecycle (`create → inspect → plan → apply → verify`), planner, execution
engine (batching, throttling, retries, checkpoints, resume, identity ledger),
local state store, verification framework, and the `sanka` CLI. The installed
distribution remains `sanka-migrate`; `sanka-migrate` is retained as a CLI
compatibility alias.

The runtime is licensed **AGPL-3.0-only**; the connector interface and bundled
first-party connectors retain **Apache-2.0** source licenses inside the same
distribution. Commercial licenses are available from Sanka, Inc. for embedding
the runtime without AGPL obligations.

**Status: alpha.** Published releases are available on
[PyPI](https://pypi.org/project/sanka-migrate/). Migration-as-code specs
(`sanka.runtime.spec`, YAML + programmatic, with env-reference resolution and
secret-key rejection) and canonical plan hashing (`sanka.runtime.hashing`) are
in place, together with the engine, state store, and CLI lifecycle commands.
APIs may still change before `1.0`.

## Django REST Framework → FastAPI

Run the four-command compatibility migration from a Django repository root:

```bash
sanka scan
sanka plan --to fastapi
sanka apply
sanka verify
```

This recipe is included in source candidate `v0.1.0a4`; the live
[PyPI project](https://pypi.org/project/sanka-migrate/) remains the publication authority.
Sanka resolves the live Django URL graph, including DRF router routes and custom actions.
Apply creates a separate FastAPI compatibility application in
`.sanka/output/fastapi`; it does not overwrite the Django source. The generated
route graph forwards to the current DRF handlers in-process so teams can prove
parity first and replace handlers incrementally.

## Python quick start

The distribution name and import name are intentionally different:

```bash
pip install sanka-migrate
```

```python
import asyncio

from sanka import Sanka

async def main() -> None:
    with Sanka() as sanka:
        source = sanka.connect("markdown", "./content")
        target = sanka.connect("sqlite", "content.db")
        migration = sanka.migrate(source, target)
        plan = await migration.plan()
        await migration.apply(plan_hash=plan.plan_hash)
        report = await migration.verify()

    assert report.ok


asyncio.run(main())
```

The same bundled-provider discovery is available from the CLI:

```bash
sanka connect hubspot
```

Advanced integrations can use the typed `sanka.runtime` modules directly.

## Public research and assessment

The CLI also reads Sanka's cited, keyless research API and can submit
a free migration assessment:

```bash
sanka research eol --after 2027-01 --type shutdown
sanka research tco salesforce --lang en
sanka research compare crm-migration --platforms salesforce,hubspot
sanka assess --source "SAP ECC" --destination "HubSpot"
```

Research output includes per-claim vendor sources and terminal attribution.
Use `--json` for the unwrapped API data payload. Filtered queries with no rows
exit `2`; API or transport failures exit `1`. The default public API base is
`https://api.sanka.com/v2/migrate`; set `SANKA_MIGRATE_API_BASE` only when
testing an explicitly trusted staging deployment.
