Metadata-Version: 2.4
Name: agentdatahub
Version: 0.1.0
Summary: Free, no-key public data for AI agents: official statistics, central bank rates, FX, energy and weather, with LangChain, LlamaIndex and CrewAI tools.
Author: Agent Data Hub
License-Expression: MIT
Project-URL: Homepage, https://api.agentdatahub.de
Project-URL: Documentation, https://api.agentdatahub.de/docs
Project-URL: Repository, https://github.com/Jona1245/agentdatahub-python
Project-URL: Issues, https://github.com/Jona1245/agentdatahub-python/issues
Keywords: ai agents,llm tools,langchain,llamaindex,crewai,mcp,open data,statistics,economic data,time series
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.3; extra == "langchain"
Provides-Extra: llamaindex
Requires-Dist: llama-index-core>=0.12; extra == "llamaindex"
Provides-Extra: crewai
Requires-Dist: crewai>=0.100; extra == "crewai"
Provides-Extra: test
Requires-Dist: pytest>=8; extra == "test"
Dynamic: license-file

# agentdatahub

Free, no-key public data for AI agents. One tool set gives your LangChain, LlamaIndex or CrewAI agent
official statistics, central bank rates, exchange rates, energy prices, weather and more:

- **Live answers** to data questions: `"inflation germany 2024"`, `"250 usd to eur"`, `"weather berlin tomorrow"`
- **Full histories** as compact CSV: World Bank indicators for every country since 1960, ECB exchange rates since 1999,
  Eurostat, ECB rates and bond yields, Statistics Canada, Destatis, German power prices
- **Every answer names its source, licence and data freshness**, so the agent can cite it
- **Short answers** (median ~500 tokens) instead of whole web pages
- No API key, no signup. Free quota: 1,000 calls per day per IP.

Service: [api.agentdatahub.de](https://api.agentdatahub.de) · Docs: [api.agentdatahub.de/docs](https://api.agentdatahub.de/docs)

## Install

```bash
pip install agentdatahub                 # client only, no dependencies
pip install "agentdatahub[langchain]"    # + LangChain tools
pip install "agentdatahub[llamaindex]"   # + LlamaIndex tools
pip install "agentdatahub[crewai]"       # + CrewAI tools
```

## LangChain

```python
from langchain.agents import create_agent
from agentdatahub.langchain import get_tools

agent = create_agent("anthropic:claude-sonnet-5-5", tools=get_tools())
agent.invoke({"messages": [{"role": "user", "content": "How did inflation in Germany and Spain develop since 2015?"}]})
```

## LlamaIndex

```python
from llama_index.core.agent.workflow import FunctionAgent
from agentdatahub.llamaindex import get_tools

agent = FunctionAgent(tools=get_tools(), llm=llm)
response = await agent.run("What is the ECB deposit rate and when did it last change?")
```

## CrewAI

```python
from crewai import Agent
from agentdatahub.crewai import get_tools

analyst = Agent(role="Economic analyst", goal="Answer with sourced numbers", backstory="...", tools=get_tools())
```

## The five tools

| Tool | What it does |
|---|---|
| `agentdatahub_ask` | Plain-language data question → live data with source and licence |
| `agentdatahub_search` | Search the endpoint catalog by keywords |
| `agentdatahub_call` | Run one endpoint with parameters; bundles answer whole tasks in one call |
| `agentdatahub_series` | Find series, or get a full time series as CSV (`start`, `end`, `resample`) |
| `agentdatahub_history` | Recorded history of an endpoint's answers over time |

Tools return compact text and report errors as text with the reason, so the agent can correct itself.

## Plain Python

```python
from agentdatahub import AgentDataHub

hub = AgentDataHub()
hub.ask("gdp per capita france")
hub.call("fx-currency-convert", {"from": "USD", "to": "EUR", "amount": 250})
hub.search_series("unemployment spain")
print(hub.get_series_csv("wb.FP.CPI.TOTL.ZG.DE", start="2015", end="2025"))
```

Other frameworks: `agentdatahub.tools.make_tool_functions()` returns the five tools as plain, typed Python functions.

## MCP instead of a package

Clients that speak the Model Context Protocol (Claude, Cursor, VS Code ...) can connect directly:
`https://api.agentdatahub.de/mcp` (Streamable HTTP, no authentication).

## Data and licences

Data comes from openly licensed public sources (CC BY 4.0, CC0, public domain, official reuse terms such as
Datenlizenz Deutschland or the ECB and Eurostat reuse policies). Each answer carries the source and licence;
please attribute the source when you reuse the data. The service is provided without warranty, see the
[terms of use](https://api.agentdatahub.de/nutzungsbedingungen).

This package is MIT licensed.
