Skip to main content

Paper - Pytorch

Project description

Swarms Tools

Join our Discord Subscribe on YouTube Connect on LinkedIn Follow on X.com

Overview

Swarms Tools is an enterprise-grade Python package designed for seamless integration of cutting-edge APIs into multi-agent orchestration systems. Built for organizations requiring robust, scalable, and maintainable automation solutions, this toolkit provides standardized interfaces for financial data, social media integration, IoT connectivity, and more.

Key Features

Feature Description
Unified API Integration Production-ready Python functions for enterprise applications
Enterprise-Grade Architecture Comprehensive type hints, structured outputs, and enterprise documentation standards
Multi-Agent System Compatibility Optimized for seamless integration into Swarms' distributed agent orchestration platforms
Extensible Framework Standardized schema for rapid tool development and deployment
Enterprise Security Secure API key management and compliance-ready implementation patterns
Bleeding Edge Performance Utilizes high-performance libraries such as httpx for async HTTP and orjson for ultra-fast serialization

Installation

pip3 install -U swarms-tools

Project Structure

swarms-tools/
├── swarms_tools/
│   ├── finance/
│   │   ├── htx_tool.py
│   │   ├── eodh_api.py
│   │   ├── coingecko_tool.py
│   │   └── defillama_mcp_tools.py
│   ├── social_media/
│   │   └── telegram_tool.py
│   ├── utilities/
│   │   └── logging.py
├── tests/
│   ├── test_financial_data.py
│   └── test_social_media.py
└── README.md

Enterprise Use Cases

Financial Data Management

Our comprehensive financial tools enable organizations to streamline operations and gain actionable insights:

Tool Name Function Description
fetch_stock_news fetch_stock_news Retrieves real-time stock news and market updates
fetch_htx_data fetch_htx_data Accesses financial data from HTX trading platform
yahoo_finance_api yahoo_finance_api Comprehensive stock data including pricing and trend analysis
coin_gecko_coin_api coin_gecko_coin_api Cryptocurrency market data and pricing information
helius_api_tool helius_api_tool Blockchain account, transaction, and token data via Helius API
okx_api_tool okx_api_tool Detailed cryptocurrency data from OKX exchange
defillama_mcp_tools get_protocol_tvl, get_chain_tvl, get_token_prices, make_request DeFi ecosystem data including protocol TVL and token pricing

Financial Data Retrieval Examples

Historical Data Analysis

from swarms_tools import fetch_htx_data

# Retrieve historical trading data for analysis
response = fetch_htx_data("swarms")
print(response)

Market News Intelligence

from swarms_tools import fetch_stock_news

# Access latest market news for strategic decision-making
news = fetch_stock_news("AAPL")
print(news)

Cryptocurrency Market Analysis

from swarms_tools import coin_gecko_coin_api

# Real-time cryptocurrency market data
crypto_data = coin_gecko_coin_api("bitcoin")
print(crypto_data)

DeFi Protocol Analytics

from swarms_tools import get_protocol_tvl

# Protocol TVL data for investment analysis
protocol_tvl = await get_protocol_tvl("uniswap-v3")
print(protocol_tvl)

Social Media Automation

Streamline corporate communication and engagement strategies:

Telegram Integration Example

from swarms_tools import telegram_dm_or_tag_api

def send_corporate_alert(response: str):
    telegram_dm_or_tag_api(response)

# Automated corporate communication
send_corporate_alert("Critical business update from Swarms Corporation.")

Dex Screener Integration

Enterprise-grade tool for accessing decentralized exchange data across multiple blockchain networks:

from swarms_tools.finance.dex_screener import (
    fetch_latest_token_boosts,
    fetch_dex_screener_profiles,
)

# Retrieve token boost data
fetch_dex_screener_profiles()
fetch_latest_token_boosts()

Tool Orchestration Framework

The tool chainer enables sequential or parallel execution of multiple tools for complex workflow automation:

from loguru import logger
from swarms_tools.structs import tool_chainer

if __name__ == "__main__":
    logger.add("tool_chainer.log", rotation="500 MB", level="INFO")

    # Define enterprise tools
    def data_analysis_tool():
        return "Data Analysis Complete"

    def reporting_tool():
        return "Report Generated"

    tools = [data_analysis_tool, reporting_tool]

    # Parallel execution for performance optimization
    parallel_results = tool_chainer(tools, parallel=True)
    print("Parallel Results:", parallel_results)

    # Sequential execution for dependency management
    sequential_results = tool_chainer(tools, parallel=False)
    print("Sequential Results:", sequential_results)

Social Media Management

Twitter API Integration

Comprehensive Twitter automation for enterprise social media management:

import os
from time import time
from swarm_models import OpenAIChat
from swarms import Agent
from dotenv import load_dotenv
from swarms_tools.social_media.twitter_tool import TwitterTool

load_dotenv()

# Initialize enterprise AI model
model_name = "gpt-4o"
model = OpenAIChat(
    model_name=model_name,
    max_tokens=3000,
    openai_api_key=os.getenv("OPENAI_API_KEY"),
)

# Configure Twitter integration
options = {
    "id": "29998836",
    "name": "mcsswarm",
    "description": "Enterprise Twitter automation platform",
    "credentials": {
        "apiKey": os.getenv("TWITTER_API_KEY"),
        "apiSecretKey": os.getenv("TWITTER_API_SECRET_KEY"),
        "accessToken": os.getenv("TWITTER_ACCESS_TOKEN"),
        "accessTokenSecret": os.getenv("TWITTER_ACCESS_TOKEN_SECRET"),
    },
}

twitter_plugin = TwitterTool(options)
post_tweet = twitter_plugin.get_function("post_tweet")

# Automated content generation and posting
def generate_corporate_content():
    content_prompt = "Generate professional corporate content for social media engagement"
    tweet_text = model.run(content_prompt)
    
    try:
        post_tweet(tweet_text)
        print(f"Content posted successfully: {tweet_text}")
    except Exception as e:
        print(f"Error posting content: {e}")

Enterprise Development Standards

Every tool in Swarms Tools adheres to enterprise-grade development standards:

Development Schema

  1. Modular Architecture: Encapsulate API logic into reusable, maintainable functions
  2. Type Safety: Comprehensive Python type hints for input validation and code clarity
  3. Documentation: Detailed docstrings with parameter specifications and usage examples
  4. Output Standardization: Consistent return formats for seamless system integration
  5. Security Compliance: Secure API key management using environment variables

Schema Template

def enterprise_data_function(parameter: str, date_range: str) -> str:
    """
    Enterprise-grade data retrieval function.

    Args:
        parameter (str): Business parameter for data retrieval
        date_range (str): Timeframe specification (e.g., '1d', '1m', '1y')

    Returns:
        str: Structured data response for enterprise systems
    """
    pass

Documentation and Support

Comprehensive enterprise documentation is available at docs.swarms.world, providing detailed API references, implementation guides, and best practices for enterprise deployment.

Community and Support

Join our enterprise community for technical support, platform updates, and exclusive access to advanced agent engineering insights:

Platform Description Link
Discord Live technical support and community Join Discord
Twitter Platform updates and announcements @swarms_corp
YouTube Technical tutorials and demonstrations Swarms Channel
Documentation Official technical documentation docs.swarms.world
Blog Technical articles and platform insights Medium
LinkedIn Professional network and corporate updates The Swarm Corporation
Events Enterprise community events and workshops Sign up here
Onboarding Enterprise onboarding with platform experts Book Session

Contributing

We welcome enterprise contributions and partnerships. To contribute:

  1. Fork the Repository: Begin by forking the main repository
  2. Create Feature Branch: Use descriptive naming: feature/enterprise-tool-name
  3. Implement Standards: Follow enterprise development guidelines
  4. Submit Pull Request: Open pull request for technical review

License

This project is licensed under the MIT License. See the LICENSE file for complete terms and conditions.


"The future belongs to those who dare to automate it."
— The Swarms Corporation

Project details


Download files

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

Source Distribution

swarms_tools-0.1.9.tar.gz (55.6 kB view details)

Uploaded Source

Built Distribution

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

swarms_tools-0.1.9-py3-none-any.whl (73.6 kB view details)

Uploaded Python 3

File details

Details for the file swarms_tools-0.1.9.tar.gz.

File metadata

  • Download URL: swarms_tools-0.1.9.tar.gz
  • Upload date:
  • Size: 55.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Darwin/24.5.0

File hashes

Hashes for swarms_tools-0.1.9.tar.gz
Algorithm Hash digest
SHA256 522a02d0542413b8c1fb95d7676a8b47681fd3df41959d26e537a19b9f9949d4
MD5 621d5ed9e4316d73bec9bfece09253ec
BLAKE2b-256 510e1d55d6c9afc7a9c6fe151a44ce111381987805d5ceccf4886ccc8cc3a387

See more details on using hashes here.

File details

Details for the file swarms_tools-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: swarms_tools-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 73.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Darwin/24.5.0

File hashes

Hashes for swarms_tools-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 b431aeafb828a2a5299175f1e3eed62d45f76b78111ae628540a4afe96142d2e
MD5 dd8c7a0801176d8c47173300e2beeb8d
BLAKE2b-256 2af8c311ea39a9b43ada15cf6da591b94fcc52cb881e9e7ae695e565aa4263a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page