Metadata-Version: 2.4
Name: chartavisa
Version: 1.0.0
Summary: Thin, dependency-free Python client for the Charta Visa agent API: visa eligibility (ESTA, UK ETA, ETIAS, Canada eTA, DS-160), fee quotes and product schemas.
Author-email: Charta Visa <support@chartavisa.com>
License: MIT
Project-URL: Homepage, https://chartavisa.com/developers
Project-URL: Documentation, https://chartavisa.com/developers
Project-URL: OpenAPI spec, https://chartavisa.com/api/v1/agent/openapi.json
Project-URL: Source, https://github.com/jorgegonzalez97/etias/tree/main/sdk/python
Keywords: visa,esta,eta,uk-eta,etias,canada-eta,ds-160,travel,travel-authorization,immigration,chartavisa,api-client
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# chartavisa (Python)

Thin, dependency-free Python client (standard-library `urllib` only) for the
[Charta Visa](https://chartavisa.com/developers) agent API.

> **Charta Visa is an independent private service, not a government website.
> Government fees are stated separately and paid to the authorities in full.**
> Full docs, MCP server and the OpenAPI spec: <https://chartavisa.com/developers>.

## Install

```bash
pip install chartavisa
```

Python 3.8+. No runtime dependencies.

## No API key needed

The three helpers below call the **public read endpoints**: no key, no
sign-up, CORS-enabled, 30 requests/minute per IP.

```python
import chartavisa

elig = chartavisa.check_eligibility("IN", "US")
# {'required': True, 'visa_type': 'DS160', 'visa_name': 'US Visitor Visa (B1/B2)',
#  'pricing': {...}, 'links': {'apply_url': ..., 'requirements_url': ...}, ...}

quote = chartavisa.quote_pricing("ESTA", processing_speed="rush", num_travelers=2, currency="eur")
print(quote["charged"])   # {'amount': ..., 'currency': 'EUR', 'fx_rate': ...}

products = chartavisa.list_visa_products()
print([p["id"] for p in products["schemas"]])   # ['ESTA', 'DS160', 'UK_ETA', 'ETIAS', 'CANADA_ETA']
```

## With an API key / other endpoints

```python
from chartavisa import ChartaVisa, ChartaVisaError

cv = ChartaVisa(api_key="cv_agent_…", user_agent_suffix="my-app/1.0")
try:
    me = cv.request("GET", "/api/v1/agent/me")
    status = cv.request("GET", "/api/v1/agent/status/<application_id>")
except ChartaVisaError as e:
    print(e.code, e.status, e.message, e.hint)
```

`request(method, path, body=None)` works for every endpoint in the
[OpenAPI spec](https://chartavisa.com/api/v1/agent/openapi.json); it unwraps
the `{ "success": true, "data": … }` envelope and raises `ChartaVisaError`
(with `.code`, `.status`, `.hint`, `.details`) on any error.

## Errors

| `code` | Meaning |
|---|---|
| `INVALID_FIELD` / `INVALID_VISA_TYPE` | Bad input (ISO-2 codes, unknown product) |
| `RATE_LIMITED` | Back off (`Retry-After` seconds in the response) |
| `UNAUTHORIZED` / `AUTH_REQUIRED` | Endpoint needs an API key |
| `NETWORK_ERROR` | Could not reach the server (`status == 0`) |

## License

MIT.
