Metadata-Version: 2.4
Name: tisura-legacy
Version: 0.0.21
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
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 :: Rust
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Summary: Tisura light SDK — TLS-verified HTTP client with offline record decryption
Author: Tisura
License: LicenseRef-Tisura-Proprietary
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Repository, https://github.com/tisura-labs/mono

# tisura (Python)

Python distribution of the [tisura-legacy](https://github.com/tisura-labs/mono/tree/dev/sentinel_sdk_legacy) light SDK.

## Install

```bash
pip install tisura-legacy
```

## Usage

```python
import asyncio
import tisura_legacy as t


async def main():
    client = t.Client("<api-key>")

    args = t.SendRequestArgs(
        server_host="<host>",
        endpoint="<path>",
        method=t.HttpMethod.GET,
        params=[],
        body=[],
        headers=[],
        server_port=None,
    )

    result = await client.send_request(args)
    plaintext = await client.rebuild_encrypted_records(result)


asyncio.run(main())
```

## Notarization

`notarize` returns a `NotarizationCertificate` and leaves the PDF untouched.
`data` is a `list[Kv]` co-notarized with the document and defaults to empty.

`sign` is the proxy-free alternative: it requests a detached ES256 signature
over the PDF and returns the verification URL. No TLS session, so no
certificate — the JWT in the URL is the whole proof.

`stamp_qr` draws the verification QR onto the PDF. It is **synchronous** — pure
local work, no network. Pass the same bytes that were notarized or signed;
`placement` overrides where the QR lands.

```python
cert = await client.notarize_and_get_certificate(pdf, [t.Kv(key="ref", value="A-42")])
stamped = client.stamp_qr(pdf, cert.verify_url)

url = await client.sign(pdf)
stamped = client.stamp_qr(pdf, url)
```

