Skip to main content
fonky

Purpose  |  Architecture  |  Structure  |  Installation  |  Integrations  |  Tool Index  |  User Guide  |  Configuration  | 


Documentation

🎯 Purpose

Fonky is a Python library that provides a unified collection of reusable tools for AI, data acquisition, document processing, web access, geospatial analysis, environmental data, and other common application workflows. It helps solve the problem of repeatedly implementing and maintaining provider-specific integrations by encapsulating existing loaders, fetchers, scrapers, preprocessors, and related utilities behind consistent, easy-to-call interfaces. Fonky can be imported directly into Python applications, notebooks, automation pipelines, or AI-agent frameworks, allowing developers to invoke individual tools as ordinary functions or expose them through provider-specific integrations such as GPT, Claude, Gemini, Grok, Mistral, and LangChain without duplicating the underlying implementation.

🛠️ Architecture

Fonky provider-native architecture

🔁 Workflow

Fonky provider tool execution workflow

📦 Package Structure

fonky/
├── __init__.py
├── boogr.py
├── config.py
├── fetchers.py
├── loaders.py
├── models.py
├── processors.py
├── scrapers.py
├── gpt/
│   ├── __init__.py
│   └── tools.py
├── claude/
│   ├── __init__.py
│   └── tools.py
├── gemini/
│   ├── __init__.py
│   └── tools.py
├── grok/
│   ├── __init__.py
│   └── tools.py
├── mistral/
│   ├── __init__.py
│   └── tools.py
└── langchain/
    ├── __init__.py
    └── tools.py

⚙️ Installation

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip wheel
python -m pip install fonky
python -m pip check

For an editable development installation from a repository checkout:

python -m pip install -e .

Playwright

python -m playwright install chromium

🔑 Configuration and API Keys

API Key Set-up Instructions

Environment Variables

config.py constant Environment variable Service / setting
AIRNOW_API_KEY AIRNOW_API_KEY AirNow
CLAUDE_API_KEY CLAUDE_API_KEY Anthropic Claude
CONGRESS_API_KEY CONGRESS_API_KEY Congress.gov / congressional data
CHROMA_API_KEY CHROMA_API_KEY Chroma
CHROMA_TENET_ID CHROMA_TENET_ID Chroma tenant identifier
GEOAPIFY_API_KEY GEOAPIFY_API_KEY Geoapify
GEOCODING_API_KEY GEOCODING_API_KEY Geocoding service
GEMINI_API_KEY GEMINI_API_KEY Google Gemini
GOOGLE_API_KEY GOOGLE_API_KEY Google APIs / Programmable Search
GOOGLE_CSE_ID GOOGLE_CSE_ID Google Programmable Search Engine ID
GOOGLE_CLOUD_PROJECT_ID GOOGLE_CLOUD_PROJECT_ID Google Cloud project
GOOGLE_CLOUD_LOCATION GOOGLE_CLOUD_LOCATION Google Cloud location
GOVINFO_API_KEY GOVINFO_API_KEY GovInfo
GOOGLE_GENAI_USE_VERTEXAI GOOGLE_GENAI_USE_VERTEXAI Google GenAI Vertex AI mode
GOOGLE_WEATHER_API_KEY GOOGLE_WEATHER_API_KEY Google Weather
GOOGLE_ACCOUNT_FILE GOOGLE_ACCOUNT_CREDENTIALS Google service-account credentials file
GOOGLE_DRIVE_TOKEN_PATH GOOGLE_DRIVE_TOKEN_PATH Google Drive OAuth token path
GOOGLE_DRIVE_FOLDER_ID GOOGLE_DRIVE_FOLDER_ID Default Google Drive folder
HUGGINGFACE_API_KEY HUGGINGFACE_API_KEY Hugging Face
IPINFO_API_KEY IPINFO_API_KEY IPinfo
OPENAI_API_KEY OPENAI_API_KEY OpenAI
PINECONE_API_KEY PINECONE_API_KEY Pinecone
LANGSMITH_API_KEY LANGSMITH_API_KEY LangSmith
LLAMAINDEX_API_KEY LLAMAINDEX_API_KEY LlamaIndex
LLAMACLOUD_API_KEY LLAMACLOUD_API_KEY LlamaCloud
MISTRAL_API_KEY MISTRAL_API_KEY Mistral
NASA_API_KEY NASA_API_KEY NASA APIs
NASA_EARTHDATA_TOKEN NASA_EARTHDATA_TOKEN NASA Earthdata
NEWS_API_KEY NEWSAPI_API_KEY NewsAPI
THENEWS_API_KEY THENEWSAPI_API_KEY TheNewsAPI
WEATHERAPI_API_KEY WEATHERAPI_API_KEY WeatherAPI
XAI_API_KEY XAI_API_KEY xAI
O365_CLIENT_ID O365_CLIENT_ID Microsoft 365 OAuth client ID
O365_CLIENT_SECRET O365_CLIENT_SECRET Microsoft 365 OAuth client secret
OPENAQ_API_KEY OPENAQ_API_KEY OpenAQ
OPENSKY_API_CLIENT_ID OPENSKY_API_CLIENT_ID OpenSky API client ID
OPENSKY_API_CREDENTIALS OPENSKY_API_CREDENTIALS OpenSky API credentials
OPENSKY_API_CLIENT_SECRET OPENSKY_API_CLIENT_ID OpenSky API client secret binding in current config.py
CENSUS_API_KEY CENSUS_API_KEY U.S. Census
SOCRATA_API_KEY SOCRATA_API_KEY Socrata
HEALTHDATA_API_KEY HEALTHDATA_API_KEY HealthData.gov
USGS_WATERDATA_API_KEY USGS_API_KEY USGS
DATA_GOV_API_KEY DATAGOV_API_KEY Data.gov
FIRMS_MAP_KEY FIRMS_MAP_KEY NASA FIRMS
PURPLEAIR_API_KEY PURPLEAIR_API_KEY PurpleAir
SKY_MAP_TOKEN SKY_MAP_TOKEN Sky Map

🤖 Provider Integrations

Provider Fonky module Native tool contract Tool-result boundary
OpenAI Agents SDK fonky.gpt.tools @function_tool objects OpenAI Agents runtime
Anthropic Claude fonky.claude.tools @beta_tool objects Local execution; return a string or supported Anthropic content block
Google ADK fonky.gemini.tools Plain typed callables Google ADK runtime
xAI Grok fonky.grok.tools Callable plus explicit *_tool schema Local execution and xAI tool-result submission
Mistral AI fonky.mistral.tools Callable plus JSON *_tool declaration Local execution; serialize content with the matching tool_call_id
LangChain fonky.langchain.tools @tool(parse_docstring=True) objects LangChain runtime

OpenAI Agents SDK

from agents import Agent, Runner

from fonky.gpt.tools import fetch_arxiv
from fonky.gpt.tools import fetch_wikipedia

agent = Agent(
    name='Research Assistant',
    instructions='Use the supplied Fonky tools when required.',
    tools=[
        fetch_arxiv,
        fetch_wikipedia,
    ] )

result = Runner.run_sync(
    agent,
    'Research retrieval augmented generation.' )

print( result.final_output )

Anthropic Claude

Fonky exposes a direct Anthropic integration through fonky.claude.tools. Each public Claude tool is decorated with Anthropic's @beta_tool and delegates directly to the canonical Fonky implementation in fetchers.py, loaders.py, scrapers.py, or processors.py.

from anthropic import Anthropic

from fonky.claude.tools import fetch_arxiv
from fonky.claude.tools import fetch_wikipedia

client = Anthropic()

tools = [
    fetch_arxiv.to_dict(),
    fetch_wikipedia.to_dict(),
]

response = client.beta.messages.create(
    model='claude-sonnet-4-6',
    max_tokens=4096,
    tools=tools,
    messages=[
        {
            'role': 'user',
            'content': 'Research retrieval augmented generation.',
        },
    ] )

print( response )

The Claude adapter does not depend on fonky.gpt or unwrap another provider's tools. It exposes the same Fonky operations as native Anthropic beta_tool objects while preserving the underlying implementation signatures, defaults, documentation, and behavior.

Structured tool results: Anthropic's automatic Tool Runner expects tool results to be strings or supported Anthropic content blocks. Fonky tools that return dictionaries, DataFrames, NumPy arrays, document collections, or other structured Python values retain those native return types. Applications using those tools in an Anthropic tool-result loop should serialize the returned value before sending it back to Claude.

Google ADK

from google.adk.agents import Agent

from fonky.gemini.tools import fetch_arxiv
from fonky.gemini.tools import fetch_wikipedia

agent = Agent(
    name='research_assistant',
    model='gemini-3.7-flash',
    instruction='Use the supplied Fonky tools when required.',
    tools=[
        fetch_arxiv,
        fetch_wikipedia,
    ] )

xAI Grok

from fonky.grok.tools import cse_search_tool
from fonky.grok.tools import fetch_cse_search

tools = [
    cse_search_tool,
]

# Pass ``tools`` to the xAI chat request.
# When Grok requests ``fetch_cse_search``, execute the callable locally:
result = fetch_cse_search(
    keywords='federal appropriations law',
    results=5 )

Mistral AI

Fonky exposes executable wrappers and Mistral-compatible JSON function declarations through fonky.mistral.tools. Each declaration is paired with a callable that delegates directly to the canonical Fonky implementation.

from mistralai.client import Mistral

from fonky.config import MISTRAL_API_KEY
from fonky.mistral.tools import cse_search_tool
from fonky.mistral.tools import fetch_cse_search

client = Mistral(
    api_key=MISTRAL_API_KEY )

tools = [
    cse_search_tool,
]

response = client.chat.complete(
    model='mistral-medium-latest',
    messages=[
        {
            'role': 'user',
            'content': 'Find sources about federal appropriations law.',
        },
    ],
    tools=tools )

result = fetch_cse_search(
    keywords='federal appropriations law',
    results=5 )

print( response )
print( result )

When Mistral returns a tool call, the application executes the matching Fonky callable locally and returns a serialized tool-result message. Fonky preserves canonical return types, so dictionaries, DataFrames, NumPy arrays, and document collections must be serialized by the calling workflow.

LangChain

from fonky.langchain.tools import fetch_arxiv
from fonky.langchain.tools import fetch_wikipedia

tools = [
    fetch_arxiv,
    fetch_wikipedia,
]

📚 Documentation

📝 License

License: MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fonky-0.1.0.tar.gz (338.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fonky-0.1.0-py3-none-any.whl (341.9 kB view details)

Uploaded Python 3

File details

Details for the file fonky-0.1.0.tar.gz.

File metadata

  • Download URL: fonky-0.1.0.tar.gz
  • Upload date:
  • Size: 338.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for fonky-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dbf4518f0eac17e15c745afa39b21839490f30b06973a433054756418fbbae5b
MD5 c090801c0101b177e55a452bd049bd50
BLAKE2b-256 af2c5d670cfd4be61a4457b315e64bf58dfbf131eed86c17470abc95f5c5972b

See more details on using hashes here.

Provenance

The following attestation bundles were made for fonky-0.1.0.tar.gz:

Publisher: publish.yml on is-leeroy-jenkins/fonky

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fonky-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fonky-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 341.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for fonky-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4d3a116e7540a76873ccdc3cca911a4bd9d01356675df301d9c8121ddf8df416
MD5 f7b53d853c70671594807fbfbcf38698
BLAKE2b-256 5d44c3a28cd80e19263e9030d1a2b2e946019dfeeced350d6c0fec586920a8b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for fonky-0.1.0-py3-none-any.whl:

Publisher: publish.yml on is-leeroy-jenkins/fonky

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page