Metadata-Version: 2.3
Name: haive-tools
Version: 1.0.0
Summary: haive-tools for Haive framework
License: MIT
Author: pr1m8
Author-email: william.astley@algebraicwealth.com
Requires-Python: >=3.12,<3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: google-search-results (>=2.4.2,<3.0.0)
Requires-Dist: haive-core (>=1.0.0,<2.0.0)
Requires-Dist: langchain (>=0.3.20,<0.4.0)
Requires-Dist: langchain-core (>=0.3.44,<0.4.0)
Requires-Dist: langgraph (>=0.3.5,<0.4.0)
Requires-Dist: pokebase (>=1.4.1,<2.0.0)
Requires-Dist: pydantic (>=2.10.6,<3.0.0)
Description-Content-Type: text/markdown

# Haive Tools - Comprehensive Tool Ecosystem

## Overview

Haive Tools provides 110+ curated tool integrations and toolkits, plus seamless integration with 100+ MCP (Model Context Protocol) servers. This package makes it easy to give your agents real-world capabilities through a standardized interface.

## Tool Categories

### 1. Web & Internet Tools

**Search & Information**

- **Web Search**: Google, Bing, DuckDuckGo, Perplexity
- **News Search**: Real-time news from multiple sources
- **Academic Search**: ArXiv, PubMed, Google Scholar
- **Social Media Search**: Twitter, Reddit, LinkedIn

**Web Interaction**

- **Web Scraping**: Beautiful Soup, Playwright integration
- **Browser Automation**: Selenium, Puppeteer wrappers
- **API Clients**: REST, GraphQL, WebSocket
- **URL Tools**: Shortening, QR codes, validation

### 2. Data & Analytics Tools

**Data Processing**

- **Pandas Integration**: DataFrame operations
- **SQL Tools**: Query builders, executors
- **Data Validation**: Schema checking, quality assurance
- **ETL Tools**: Extract, transform, load pipelines

**Visualization**

- **Chart Generation**: Matplotlib, Plotly, D3.js
- **Dashboard Creation**: Streamlit, Dash integration
- **Report Generation**: PDF, HTML, Markdown

**Analysis**

- **Statistical Tools**: SciPy, StatsModels
- **ML Integration**: Scikit-learn, XGBoost
- **Time Series**: Prophet, ARIMA
- **Text Analytics**: Sentiment, NER, classification

### 3. Document Tools

**File Processing**

- **PDF Tools**: Read, write, merge, split, OCR
- **Office Files**: Excel, Word, PowerPoint manipulation
- **Image Processing**: PIL, OpenCV integration
- **Audio/Video**: Transcription, extraction

**Document Intelligence**

- **Text Extraction**: From any format
- **Table Extraction**: Structured data from documents
- **Form Processing**: Extract form fields
- **Document Classification**: Auto-categorization

### 4. Communication Tools

**Messaging**

- **Email**: Send, receive, parse (Gmail, Outlook)
- **Slack Integration**: Read, post, react
- **Discord Tools**: Bot capabilities
- **SMS/WhatsApp**: Through Twilio

**Calendar & Scheduling**

- **Google Calendar**: CRUD operations
- **Outlook Calendar**: Full integration
- **Scheduling**: Find available slots
- **Meeting Tools**: Zoom, Teams integration

### 5. Development Tools

**Code Execution**

- **Python Executor**: Safe sandboxed execution
- **JavaScript Runner**: Node.js integration
- **SQL Executor**: Multi-database support
- **Shell Commands**: Controlled system access

**Code Analysis**

- **Linting**: Multiple language support
- **Complexity Analysis**: Cyclomatic complexity
- **Security Scanning**: Vulnerability detection
- **Documentation Generation**: Auto-docs

**Version Control**

- **Git Operations**: Clone, commit, push, pull
- **GitHub Integration**: Issues, PRs, Actions
- **GitLab Tools**: Full API access
- **Code Review**: Automated suggestions

### 6. Database Tools

**SQL Databases**

- **PostgreSQL**: Full CRUD + advanced features
- **MySQL/MariaDB**: Complete integration
- **SQLite**: Local database operations
- **SQL Server**: Enterprise features

**NoSQL Databases**

- **MongoDB**: Document operations
- **Redis**: Caching and pub/sub
- **Elasticsearch**: Search and analytics
- **DynamoDB**: AWS integration

**Vector Databases**

- **Pinecone**: Vector search
- **Weaviate**: Semantic search
- **Qdrant**: Neural search
- **ChromaDB**: Local vector store

### 7. AI/ML Tools

**Model Integration**

- **OpenAI Tools**: GPT, DALL-E, Whisper
- **Anthropic**: Claude integration
- **HuggingFace**: Model hub access
- **Local Models**: Ollama, LlamaCpp

**Computer Vision**

- **Image Recognition**: Object detection
- **Face Recognition**: Detection and matching
- **OCR**: Multiple language support
- **Image Generation**: Stable Diffusion, DALL-E

**NLP Tools**

- **Translation**: 100+ languages
- **Summarization**: Extractive and abstractive
- **Entity Recognition**: People, places, organizations
- **Sentiment Analysis**: Fine-grained analysis

### 8. Financial Tools

**Market Data**

- **Stock Prices**: Real-time and historical
- **Crypto**: Prices, volumes, DeFi data
- **Forex**: Currency exchange rates
- **Economic Indicators**: GDP, inflation, etc.

**Analysis Tools**

- **Technical Analysis**: Indicators, patterns
- **Portfolio Analysis**: Risk, returns, optimization
- **Financial Calculations**: NPV, IRR, amortization
- **Tax Calculators**: Multi-jurisdiction

### 9. Geographic Tools

**Mapping**

- **Geocoding**: Address to coordinates
- **Reverse Geocoding**: Coordinates to address
- **Route Planning**: Directions, optimization
- **Map Generation**: Static and interactive

**Location Services**

- **Distance Calculations**: Haversine, driving
- **Timezone Tools**: Conversion, DST handling
- **Weather Data**: Current and forecast
- **Points of Interest**: Nearby places

### 10. Utility Tools

**Math & Science**

- **Calculator**: Advanced operations
- **Unit Conversion**: All standard units
- **Scientific Constants**: Physics, chemistry
- **Formula Evaluation**: LaTeX, MathML

**Time & Date**

- **Date Parsing**: Natural language
- **Time Calculations**: Durations, differences
- **Scheduling Logic**: Recurrence rules
- **Holiday Calendars**: Multiple countries

**Text Utilities**

- **Text Manipulation**: Split, join, replace
- **Encoding/Decoding**: Base64, URL, etc.
- **Hashing**: MD5, SHA, bcrypt
- **Regex Tools**: Match, extract, replace

## MCP (Model Context Protocol) Integration

### What is MCP?

MCP provides a standard protocol for connecting AI models to external data sources and tools.

### 100+ MCP Servers

- **Database Servers**: Direct DB access
- **File System Servers**: Local and remote files
- **API Servers**: REST endpoint access
- **Application Servers**: App-specific integrations

### Seamless Integration

```python
from haive.tools import MCPToolkit

# Auto-discover available MCP servers
toolkit = MCPToolkit()
available_servers = toolkit.discover()

# Connect to specific server
db_tools = toolkit.connect("postgresql://localhost/mydb")
```

## Tool Usage Patterns

### Basic Tool Usage

```python
from haive.tools import WebSearch, Calculator

# Single tool
search = WebSearch()
results = search.search("Haive framework")

# Multiple tools
tools = [WebSearch(), Calculator(), EmailSender()]
agent = Agent(tools=tools)
```

### Toolkit Usage

```python
from haive.tools.toolkits import DataAnalysisToolkit

# Get all related tools at once
toolkit = DataAnalysisToolkit()
# Includes: pandas_tool, visualization_tool, stats_tool, etc.
```

### Dynamic Tool Loading

```python
from haive.tools import ToolRegistry

# Discover tools by capability
registry = ToolRegistry()
search_tools = registry.find_by_capability("search")
math_tools = registry.find_by_capability("calculation")
```

### Tool Composition

```python
from haive.tools import compose_tools

# Chain tools together
pipeline = compose_tools([
    WebSearch(),
    TextExtractor(),
    Summarizer(),
    EmailSender()
])

result = pipeline.run("Research and email me about quantum computing")
```

## Advanced Features

### Tool Authentication

```python
from haive.tools import configure_auth

# Configure once, use everywhere
configure_auth({
    "openai": "sk-...",
    "google": {"client_id": "...", "client_secret": "..."},
    "slack": {"token": "xoxb-..."}
})
```

### Rate Limiting

```python
from haive.tools import RateLimitedTool

# Automatic rate limiting
search = RateLimitedTool(
    WebSearch(),
    calls_per_minute=60
)
```

### Caching

```python
from haive.tools import CachedTool

# Cache expensive operations
cached_search = CachedTool(
    WebSearch(),
    cache_duration=3600  # 1 hour
)
```

### Error Handling

```python
from haive.tools import SafeTool

# Graceful error handling
safe_tool = SafeTool(
    DatabaseQuery(),
    fallback="Database temporarily unavailable"
)
```

## Best Practices

1. **Use Toolkits**: Group related tools together
2. **Configure Authentication**: Set up once at startup
3. **Handle Errors**: Use SafeTool wrapper
4. **Cache Results**: For expensive operations
5. **Respect Rate Limits**: Use RateLimitedTool
6. **Log Tool Usage**: Built-in usage analytics
7. **Test Tools**: Each tool includes test suites

## Creating Custom Tools

```python
from haive.tools import BaseTool

class MyCustomTool(BaseTool):
    name = "my_tool"
    description = "Does something useful"

    def _run(self, input: str) -> str:
        # Your implementation
        return f"Processed: {input}"
```

_Note: Each tool includes detailed documentation, examples, and integration guides. Tools are continuously updated and tested for reliability._

