Metadata-Version: 2.4
Name: toolfront
Version: 0.2.13
Summary: ToolFront helps you retrieve information from large databases, APIs, and documents with AI.
Author-email: Esteban Safranchik <esteban@kruskal.ai>, Gavin Chan <gavin@kruskal.ai>
License: MIT
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.1.8
Requires-Dist: httpx>=0.28.1
Requires-Dist: mcp[cli]>=1.9.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: pandas>=2.2.3
Requires-Dist: pydantic>=2.11.4
Requires-Dist: pytest>=8.3.5
Requires-Dist: python-decouple>=3.8
Requires-Dist: openapi-spec-validator>=0.7.2
Requires-Dist: jsonref>=1.1.0
Requires-Dist: pydantic-ai>=0.4.2
Requires-Dist: yarl>=1.20.1
Requires-Dist: rich>=14.0.0
Requires-Dist: sqlparse>=0.5.3
Requires-Dist: tabulate>=0.9.0
Requires-Dist: ibis-framework>=10.6.0
Requires-Dist: pyarrow<19.0.0
Requires-Dist: executing>=2.2.0
Provides-Extra: test
Requires-Dist: pytest>=7.0.0; extra == "test"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "test"
Provides-Extra: dev
Requires-Dist: pre-commit>=3.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mkdocs-material[imaging]>=9.6.16; extra == "dev"
Requires-Dist: mkdocstrings[python]>=0.30.0; extra == "dev"
Requires-Dist: markitdown[docx,pdf,pptx,xls,xlsx]>=0.1.2; extra == "dev"
Provides-Extra: bigquery
Requires-Dist: ibis-framework[bigquery]>=10.6.0; extra == "bigquery"
Provides-Extra: clickhouse
Requires-Dist: ibis-framework[clickhouse]>=10.6.0; extra == "clickhouse"
Provides-Extra: databricks
Requires-Dist: ibis-framework[databricks]>=10.6.0; extra == "databricks"
Provides-Extra: druid
Requires-Dist: ibis-framework[druid]>=10.6.0; extra == "druid"
Provides-Extra: duckdb
Requires-Dist: ibis-framework[duckdb]>=10.6.0; extra == "duckdb"
Provides-Extra: flink
Requires-Dist: ibis-framework[flink]>=10.6.0; extra == "flink"
Provides-Extra: mssql
Requires-Dist: ibis-framework[mssql]>=10.6.0; extra == "mssql"
Provides-Extra: mysql
Requires-Dist: ibis-framework[mysql]>=10.6.0; extra == "mysql"
Provides-Extra: oracle
Requires-Dist: ibis-framework[oracle]>=10.6.0; extra == "oracle"
Provides-Extra: postgres
Requires-Dist: ibis-framework[postgres]>=10.6.0; extra == "postgres"
Provides-Extra: risingwave
Requires-Dist: ibis-framework[risingwave]>=10.6.0; extra == "risingwave"
Provides-Extra: snowflake
Requires-Dist: ibis-framework[snowflake]>=10.6.0; extra == "snowflake"
Provides-Extra: sqlite
Requires-Dist: ibis-framework[sqlite]>=10.6.0; extra == "sqlite"
Provides-Extra: trino
Requires-Dist: ibis-framework[trino]>=10.6.0; extra == "trino"
Provides-Extra: pyspark
Requires-Dist: ibis-framework[pyspark]>=10.6.0; extra == "pyspark"
Provides-Extra: all
Requires-Dist: toolfront[bigquery]; extra == "all"
Requires-Dist: toolfront[clickhouse]; extra == "all"
Requires-Dist: toolfront[databricks]; extra == "all"
Requires-Dist: toolfront[druid]; extra == "all"
Requires-Dist: toolfront[duckdb]; extra == "all"
Requires-Dist: toolfront[mssql]; extra == "all"
Requires-Dist: toolfront[mysql]; extra == "all"
Requires-Dist: toolfront[oracle]; extra == "all"
Requires-Dist: toolfront[postgres]; extra == "all"
Requires-Dist: toolfront[pyspark]; extra == "all"
Requires-Dist: toolfront[risingwave]; extra == "all"
Requires-Dist: toolfront[snowflake]; extra == "all"
Requires-Dist: toolfront[sqlite]; extra == "all"
Requires-Dist: toolfront[trino]; extra == "all"
Dynamic: license-file

<p align="center">
  <a href="https://github.com/kruskal-labs/toolfront">
    <img src="https://raw.githubusercontent.com/kruskal-labs/toolfront/main/img/logo.png" width="150" alt="ToolFront Logo">
  </a>
</p>

<div align="center">

*Simple data retrieval for AI with unmatched control, precision, and speed.*

[![Test Suite](https://github.com/kruskal-labs/toolfront/actions/workflows/test.yml/badge.svg)](https://github.com/kruskal-labs/toolfront/actions/workflows/test.yml)
[![PyPI package](https://img.shields.io/pypi/v/toolfront?color=%2334D058&label=pypi%20package)](https://pypi.org/project/toolfront/)
[![Discord](https://img.shields.io/discord/1323415085011701870?label=Discord&logo=discord&logoColor=white&style=flat-square)](https://discord.gg/rRyM7zkZTf)
[![X](https://img.shields.io/badge/ToolFront-black?style=flat-square&logo=x&logoColor=white)](https://x.com/toolfront)

</div>

---

**Documentation: [docs.toolfront.ai](http://docs.toolfront.ai/)**

---

## Installation

Install with `pip` or your favorite PyPI package manager.

```bash
pip install toolfront
```

## Example 1: Text2SQL with ChatGPT

```python
from toolfront import Database

db = Database("postgres://user:pass@localhost:5432/mydb", model="openai:gpt-4o")

context = "We're an e-commerce company. Sales data is in the `cust_orders` table."

# Returns a string
answer = db.ask("What's our best-selling product?", context=context)
# >>> "Wireless Headphones Pro"
```

> **Note**: For databases, install with PyPI extras, e.g.: `pip install "toolfront[postgres]"`. See the [documentation](http://docs.toolfront.ai/) for the complete list of 10+ databases.

## Example 2: API retrieval with Claude

```python
from toolfront import API

api = API("http://localhost:8000/openapi.json", model="anthropic:claude-3-5-sonnet")

# Returns a list of integers
answer: list[int] = api.ask("Get the last 5 order IDs for user_id=42")
# >>> [1001, 998, 987, 976, 965]
```

> **Note**: ToolFront supports any API with an OpenAPI (formerly Swagger) specification. Most common APIs like Slack, Discord, and GitHub have OpenAPI specs. See the [documentation](http://docs.toolfront.ai/) for more details.


## Example 3: Document information extraction with Gemini

```python
from toolfront import Document
from pydantic import BaseModel, Field

class CompanyReport(BaseModel):
    company_name: str = Field(..., description="Name of the company")
    revenue: int | float = Field(..., description="Annual revenue in USD")
    is_profitable: bool = Field(..., description="Whether the company is profitable")

doc = Document("/path/annual_report.pdf", model="google:gemini-pro")

# Returns a structured Pydantic object
answer: CompanyReport = doc.ask("Extract the key company information from this report")
# >>> CompanyReport(company_name="TechCorp Inc.", revenue=2500000, is_profitable=True)
```

> **Note**: ToolFront supports OpenAI, Anthropic, Google, xAI, and 14+ AI model providers. See the [documentation](http://docs.toolfront.ai/) for the complete list.


## Example 4: Snowflake MCP Server

```json
{
  "mcpServers": {
    "toolfront": {
      "command": "uvx",
      "args": [
        "toolfront[snowflake]", 
        "snowflake://user:pass@account/warehouse/database"
      ]
    }
  }
}
```

## Community & Contributing

- **Discord**: Join our [community server](https://discord.gg/rRyM7zkZTf) for real-time help and discussions
- **X**: Follow us [@toolfront](https://x.com/toolfront) for updates and news
- **Issues**: Report bugs or request features on [GitHub Issues](https://github.com/kruskal-labs/toolfront/issues)

## License

This project is licensed under the terms of the MIT license.
