8000 GitHub - TechWithTy/manychat: ManyChat API SDK for Python - Async, type-safe client for ManyChat's Facebook API with comprehensive feature coverage and production-ready reliability.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ManyChat API SDK for Python - Async, type-safe client for ManyChat's Facebook API with comprehensive feature coverage and production-ready reliability.

Notifications You must be signed in to change notification settings

TechWithTy/manychat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ManyChat Python SDK: Async API Client for ManyChat

Python License: MIT Code style: black PyPI version

A high-performance, fully asynchronous Python SDK for the ManyChat API. Built with modern Python practices, type safety, and developer experience in mind. Perfect for building scalable chatbots, automation workflows, and marketing tools.

🚀 Key Features

  • 100% Asynchronous – Built with asyncio for maximum performance
  • Type Safe – Full type hints and Pydantic validation
  • Production Ready – Battle-tested in high-traffic environments
  • Complete API Coverage – All ManyChat endpoints implemented
  • Developer Friendly – Intuitive API design with detailed documentation

📦 Installation

pip install manychat-sdk
# or with poetry
poetry add manychat-sdk
📚 Documentation
Full Documentation

API Reference

💡 Quick Start
1. Initialize Client
python
Copy
Edit
from manychat import ManyChatClient

async def main():
    async with ManyChatClient(api_key="your_api_key") as client:
        # Start using the client
        ...
2. Get Page Information
python
Copy
Edit
from manychat.api.facebook import get_page_info
from manychat import ManyChatClient

async def show_page_info():
    async with ManyChatClient() as client:
        page = await get_page_info(client)
        print(f"Page: {page.data.name}")
        print(f"Category: {page.data.category}")
3. Manage Subscribers
python
Copy
Edit
from manychat.api.facebook.subscriber import get_subscriber_info, add_tag_by_name
from manychat import ManyChatClient

async def tag_vip_customer(subscriber_id: str):
    async with ManyChatClient() as client:
        # Get subscriber details
        subscriber = await get_subscriber_info(client, subscriber_id=subscriber_id)
        
        # Add VIP tag
        await add_tag_by_name(
            client,
            subscriber_id=subscriber_id,
            tag_name="VIP"
        )
🔄 API Endpoints
Facebook API
get_page_info() – Get page details and statistics

get_tags() – List all available tags

set_bot_fields() – Update bot configuration

Subscriber Management
get_subscriber_info() – Retrieve subscriber details

add_tag_by_name() – Tag subscribers

remove_tag() – Remove tags

set_custom_field() – Update subscriber fields

🛠️ Advanced Usage
Error Handling
python
Copy
Edit
from manychat.exceptions import ManyChatRateLimitError, ManyChatAPIError
from manychat import ManyChatClient
from manychat.api.facebook import get_page_info

async def safe_call():
    try:
        async with ManyChatClient() as client:
            await get_page_info(client)
    except ManyChatRateLimitError as e:
        print(f"Rate limited! Try again in {e.retry_after} seconds")
    except ManyChatAPIError as e:
        print(f"API Error: {e}")
Configuration Options
python
Copy
Edit
from manychat import ManyChatConfig

config = ManyChatConfig(
    api_key="your_api_key",
    timeout=30,         # seconds
    max_retries=3,
    base_url="https://api.manychat.com"
)
🧪 Testing
bash
Copy
Edit
# Run tests
pytest tests/ -v

# With coverage
pytest --cov=manychat tests/
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.

📄 License
This project is licensed under the MIT License – see the LICENSE file for details.

About

ManyChat API SDK for Python - Async, type-safe client for ManyChat's Facebook API with comprehensive feature coverage and production-ready reliability.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0