Metadata-Version: 2.4
Name: tallia
Version: 0.2.0
Summary: Python SDK for the Tallia API
Author: Revax Technologies Limited
License-Expression: MIT
Project-URL: Homepage, https://tallia.ai
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
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: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: CONTRIBUTORS.md
Requires-Dist: httpx<1,>=0.27
Requires-Dist: pydantic<3,>=2.3
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: pyyaml>=6; extra == "dev"
Dynamic: license-file

# tallia

The Python SDK for the Tallia API: cited tax research, your firm's documents, document review, agent runs and UK
company data, from your own systems.

The Tallia API is in early access. If your firm would like access, email info@tallia.ai.

You need an API key. Once your firm has access, its admin creates keys in Tallia under Settings, API access. A key
is shown once and is a secret for your servers.

```bash
pip install tallia
```

```python
from tallia import Tallia

with Tallia() as client:  # reads TALLIA_API_KEY from the environment
    me = client.me()
    print(me.data.firm.name)

    job = client.research.run("When is a close company's loan to a participator taxed under s455 CTA 2010?")
    if job.status == "needs_clarification":
        for q in job.questions:  # answer with client.research.answer(job.job_id, {q.id: "..."}), then wait
            print(q.prompt)
    else:
        print(job.result.answer)
        for source in job.result.sources:
            print(source)
```

The SDK waits and retries a per-minute rate limit and raises `RateLimitError` at once on a per-day limit. Every
error is a subclass of `TalliaError` carrying `code`, `status` and `request_id`.

The package also installs a `tallia` command, so you can check your key and try a question before you write
any code:

```bash
tallia setup      # paste your key once; it is checked, then saved on this computer
tallia whoami
tallia ask "When is corporation tax due for a large company?"
```

`tallia ask` makes the same calls as `client.research.run()` and uses your firm's credits the same way.
Output is plain text when piped or redirected, and when `NO_COLOR` is set.
`tallia setup` saves the key to `~/.config/tallia/config.json`, readable only by you. Only the command reads
that file; your code still takes the key from `TALLIA_API_KEY` or the constructor, and `TALLIA_API_KEY` wins
when both are set.

The API is plain HTTPS with a Bearer key, so any HTTP client works too:

```bash
curl -s https://api.tallia.ai/me -H "Authorization: Bearer $TALLIA_API_KEY"
```

Python 3.10 or later.

Answers are research to support your work, not tax or other professional advice, so review them before you rely on
them. Use of the API is covered by your firm's agreement with Revax Technologies Limited (https://tallia.ai/terms).
This SDK's code is under the MIT licence.
