Metadata-Version: 2.4
Name: foodtales
Version: 0.1.0
Summary: Official Python SDK for the Food Tales Knowledge API
Author: Food Tales
License-Expression: MIT
Project-URL: Homepage, https://knowledge.foodtales.ai
Project-URL: Documentation, https://foodtales.ai/docs/sdks
Project-URL: Source, https://github.com/pingalia/recipes-pipeline/tree/main/sdk/python
Project-URL: Issues, https://github.com/pingalia/recipes-pipeline/issues
Keywords: foodtales,knowledge-api,dishes,recipes,cuisine,sdk
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Dynamic: license-file

# `foodtales`

Official Python SDK for the [Food Tales Knowledge API](https://knowledge.foodtales.ai).

Zero runtime dependencies (stdlib `urllib` only).

## Install

```bash
pip install foodtales
# or
uv pip install foodtales
# or
poetry add foodtales
```

## Quickstart

```python
import os
from foodtales import FoodTalesClient, FoodTalesError

ft = FoodTalesClient(api_key=os.environ["FOODTALES_API_KEY"])

try:
    page = ft.search(q="biryani", limit=5, mode="lexical")
    print(page.data)
    print(page.credits)  # used / remaining / reset_at
except FoodTalesError as err:
    print(err.status, err.code, err.message)
```

## Methods

| Method | Endpoint |
| --- | --- |
| `search` | `GET /v1/search` |
| `get_dish` | `GET /v1/dishes/{ref}` |
| `dish_relationships` | `GET /v1/dishes/{ref}/relationships` |
| `dish_ingredients` | `GET /v1/dishes/{ref}/ingredients` |
| `dish_recipes` | `GET /v1/dishes/{ref}/recipes` |
| `similar_dishes` | `GET /v1/similar/dishes/{ref}` |
| `similar_recipes` | `GET /v1/similar/recipes/{ref}` |
| `search_ingredients` | `GET /v1/ingredients` |
| `get_ingredient` | `GET /v1/ingredients/{id}` |
| `ingredient_recipes` | `GET /v1/ingredients/{id}/recipes` |
| `coverage` | `GET /v1/coverage/dishes` |
| `trust` / `browse` / `siblings` | public demo endpoints (no key) |

Auth header: `X-Api-Key`.

## Docs

- Website: [foodtales.ai/docs/sdks](https://foodtales.ai/docs/sdks)
- Knowledge API: [knowledge.foodtales.ai](https://knowledge.foodtales.ai)
- OpenAPI: [knowledge.foodtales.ai/openapi.json](https://knowledge.foodtales.ai/openapi.json)

## Develop (contributors)

```bash
pip install ./sdk/python
python -m unittest discover -s sdk/python/tests -v
```
