Metadata-Version: 2.4
Name: gigai-tools
Version: 0.1.0
Summary: Client for the GigAI Tools API - run PDF, image, SVG and QR tools from Python. Free plan, no dependencies.
Author-email: Gigai Kripa Services <hello@gigaikripaservices.com>
License: MIT
Project-URL: Homepage, https://gigai.tools/developers
Project-URL: Documentation, https://gigai.tools/developers
Keywords: pdf,merge,split,image,convert,resize,compress,qr,svg,api
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# gigai-tools

Python client for the [GigAI Tools API](https://gigai.tools/developers). Run PDF, image, SVG and QR tools from code. The free plan gives 1,000 tasks a month with no card.

No dependencies. Python 3.9+.

## Install

```
pip install gigai-tools
```

## Get a key

Create an account at [gigai.tools/developers](https://gigai.tools/developers) and make an API key in the dashboard. Set it as `GIGAI_API_KEY` or pass `api_key=`.

## One call

```python
from gigai_tools import Client

client = Client()

# Merge two PDFs
client.run("merge-pdf", files=["a.pdf", "b.pdf"], output="merged.pdf")

# Compress an image to fit under 200 KB
client.run("compress-image", files=["photo.jpg"], options={"target_kb": 200}, output="small.jpg")

# Generate a QR code (no input file - the text is the payload)
client.run("generate-qr", options={"text": "https://example.com"}, output="qr.png")
```

`run()` imports your files, runs the tool, exports the result and downloads it. Files can also be `https://` URLs and the server fetches them.

## Tools

```python
for tool in client.tools():
    print(tool["slug"], "-", tool["description"])
```

Live engines: merge-pdf, split-pdf, rotate-pdf, pdf-to-text, convert-image, resize-image, compress-image, optimize-svg, markdown-to-html, generate-qr. The catalog only lists tools the API can actually run.

## Job graphs

Chain tools in one job. Each task names its inputs and the server runs them in dependency order:

```python
job = client.create_job({
    "in":  {"operation": "import/url", "url": "https://example.com/report.pdf"},
    "rot": {"operation": "rotate-pdf", "input": ["in"], "angle": 90},
    "txt": {"operation": "pdf-to-text", "input": ["rot"]},
    "out": {"operation": "export/url", "input": ["txt"]},
}, retention_s=600)

job = client.wait(job["id"])
export = next(t for t in job["tasks"] if t["name"] == "out")
client.download(export["result"]["files"][0]["url"], "report.txt")
```

`Idempotency-Key` makes retries safe: pass `idempotency_key=` and the same key returns the same job instead of running the work twice.

## Errors

Every failure raises `GigaiError` with a machine-readable `code` (`invalid_option`, `file_too_large`, `quota_exceeded`, `target_unreachable`, ...), the human message, and the offending parameter when there is one.

## Privacy

File contents are never logged. Results are deleted after the retention you choose (default 1 hour, `retention_s=0` means one download or 60 seconds) and deletion is verified. The web tools at [gigai.tools](https://gigai.tools) never need an account - accounts exist only for this API.
