Metadata-Version: 2.4
Name: function-schema-generator
Version: 0.1.0
Summary: Automatically generate OpenAI and Anthropic function calling JSON schemas from Python function signatures.
Author-email: Encephos <magiltraun@gmail.com>
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Function Schema Generator

A zero-dependency Python micro-tool that uses reflection (`inspect`) to automatically generate function calling JSON schemas for **OpenAI** (GPT-4o, Groq, Ollama) and **Anthropic** (Claude 3/3.5) directly from your Python functions.

## Installation

```bash
pip install function-schema-generator
```

## Usage

```python
import json
from function_schema_generator import generate_openai_schema, generate_anthropic_schema

def get_stock_price(ticker: str, currency: str = "USD"):
    """Fetches the current stock price for a given ticker symbol."""
    pass

# Generate OpenAI Format
openai_schema = generate_openai_schema(get_stock_price)
print("OpenAI Schema:\n", json.dumps(openai_schema, indent=2))

# Generate Anthropic (Claude) Format
anthropic_schema = generate_anthropic_schema(get_stock_price)
print("Anthropic Schema:\n", json.dumps(anthropic_schema, indent=2))
```
