gmgnapi


Namegmgnapi JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryProfessional Python client for GMGN.ai WebSocket API - Real-time Solana blockchain data streams
upload_time2025-07-29 18:19:25
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords gmgn gmgn-api solana blockchain websocket crypto defi trading api real-time data cryptocurrency api-client streaming
VCS
bugtrack_url
requirements pytest pytest-asyncio pytest-cov black isort flake8 mypy pre-commit websockets aiohttp pydantic python-dateutil
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # GmGnAPI

**Professional Python client library for GMGN.ai WebSocket API**

[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Discord](https://img.shields.io/discord/YOUR_DISCORD_ID?color=7289da&label=Discord&logo=discord&logoColor=white)](https://discord.gg/ub46R9Dk)

GmGnAPI provides real-time access to Solana blockchain data through GMGN.ai's WebSocket API with advanced features including intelligent filtering, data export capabilities, monitoring statistics, and automated alerting.

## ๐Ÿ”— Quick Links

- ๐Ÿ“š **[Documentation](https://yourusername.github.io/GmGnAPI/)** - Complete guides and API reference
- ๐Ÿ’ฌ **[Discord Community](https://discord.gg/ub46R9Dk)** - Get help and discuss strategies
- ๐ŸŒ **[Create GMGN Account](https://gmgn.ai/?ref=9dLKvFyE&chain=sol)** - Sign up with our referral link to support the project

## ๐Ÿš€ Features

### Core Functionality
- **Real-time WebSocket connection** to GMGN.ai API
- **Multiple data channels**: New pools, token launches, pair updates, chain statistics, social info, wallet trades, limit orders
- **Automatic reconnection** with exponential backoff
- **Comprehensive error handling** and logging
- **Type-safe** with full Pydantic model validation
- **Async/await** support for modern Python applications

### Advanced Features
- **๐Ÿ” Intelligent Filtering**: Advanced token filtering by market cap, liquidity, volume, holder count, exchange, and risk scores
- **๐Ÿ“Š Data Export**: Export to JSON, CSV, or SQLite database with automatic file rotation and compression
- **๐Ÿ“ˆ Monitoring & Statistics**: Real-time connection metrics, message counts, unique token/pool tracking
- **๐Ÿšจ Alert System**: Configurable alerts for market conditions with rate limiting and webhook support
- **โšก Rate Limiting**: Configurable message processing limits to prevent overwhelming
- **๐Ÿ”„ Queue Management**: Buffered message processing with configurable queue sizes

## ๐Ÿ“ฆ Installation

```bash
pip install gmgnapi
```

### Development Installation

```bash
git clone https://github.com/yourusername/gmgnapi.git
cd gmgnapi
pip install -e .
```

## ๐Ÿ”‘ Account Setup

### 1. Create GMGN Account
Create your GMGN account using our referral link to support the project:
๐Ÿ‘‰ **[Create GMGN Account](https://gmgn.ai/?ref=9dLKvFyE&chain=sol)**

### 2. Get API Token
1. Log in to your GMGN account
2. Navigate to Account Settings
3. Generate an API token
4. Copy and securely store your token

### 3. Join Community
Join our Discord server for support and updates:
๐Ÿ‘‰ **[Discord Community](https://discord.gg/ub46R9Dk)**

## ๐ŸŽฏ Quick Start

### Basic Usage

```python
import asyncio
from gmgnapi import GmGnClient

async def on_new_pool(pool_info):
    if pool_info.pools:
        pool = pool_info.pools[0]
        token_info = pool.bti
        if token_info:
            print(f"New pool: {token_info.s} ({token_info.n})")

async def main():
    client = GmGnClient()
    client.on_new_pool(on_new_pool)
    
    await client.connect()
    await client.subscribe_new_pools()
    
    # Keep running
    while True:
        await asyncio.sleep(1)

asyncio.run(main())
```

### Advanced Usage with Filtering and Export

```python
import asyncio
from decimal import Decimal
from gmgnapi import (
    GmGnEnhancedClient, 
    TokenFilter, 
    DataExportConfig,
    AlertConfig
)

async def main():
    # Configure advanced token filtering
    token_filter = TokenFilter(
        min_market_cap=Decimal("50000"),       # $50k minimum market cap
        min_liquidity=Decimal("10000"),        # $10k minimum liquidity
        min_volume_24h=Decimal("5000"),        # $5k minimum daily volume
        min_holder_count=10,                   # 10+ holders
        exchanges=["raydium", "orca"],         # Specific exchanges only
        exclude_symbols=["SCAM", "TEST"],      # Exclude potential scams
        max_risk_score=0.7,                    # Maximum risk threshold
    )
    
    # Configure data export
    export_config = DataExportConfig(
        enabled=True,
        format="json",                         # "json", "csv", or "database"
        file_path="./gmgn_data",              # Export directory
        max_file_size_mb=50,                  # File rotation at 50MB
        rotation_interval_hours=6,            # Rotate every 6 hours
        compress=True,                        # Enable compression
    )
    
    # Configure alerts
    alert_config = AlertConfig(
        enabled=True,
        webhook_url="https://hooks.slack.com/...",  # Optional webhook
        conditions=[
            {
                "type": "high_value_pool",
                "min_market_cap": 100000,
                "description": "Alert for pools > $100k"
            }
        ],
        rate_limit_seconds=300,               # Max 1 alert per 5 minutes
    )
    
    # Initialize enhanced client
    client = GmGnEnhancedClient(
        token_filter=token_filter,
        export_config=export_config,
        alert_config=alert_config,
        rate_limit=100,                       # Max 100 messages/second
    )
    
    # Event handlers
    async def on_new_pool(pool_info):
        if pool_info.pools:
            pool = pool_info.pools[0]
            token_info = pool.bti
            if token_info:
                print(f"๐Ÿ”ฅ Filtered pool: {token_info.s} - ${token_info.mc:,}")
    
    async def on_volume_spike(pair_data):
        if pair_data.volume_24h_usd > Decimal("500000"):
            print(f"๐Ÿ“ˆ Volume spike: ${pair_data.volume_24h_usd:,}")
    
    client.on_new_pool(on_new_pool)
    client.on_pair_update(on_volume_spike)
    
    # Connect and subscribe
    await client.connect()
    await client.subscribe_all_channels()
    
    # Monitor and get statistics
    while True:
        await asyncio.sleep(60)
        
        stats = client.get_monitoring_stats()
        print(f"๐Ÿ“Š Stats: {stats.total_messages:,} messages, "
              f"{stats.unique_tokens_seen} tokens, "
              f"{stats.unique_pools_seen} pools")

asyncio.run(main())
```

## ๐Ÿ“‹ Available Channels

### Public Channels
- **`new_pools`**: New liquidity pool creation events
- **`pair_update`**: Trading pair price and volume updates  
- **`token_launch`**: New token launch notifications
- **`chain_stats`**: Blockchain statistics and metrics

### Authenticated Channels (require access token)
- **`token_social`**: Token social media and community information
- **`wallet_trades`**: Wallet trading activity and transactions
- **`limit_orders`**: Limit order updates and fills

## ๐Ÿ”ง Configuration Options

### TokenFilter
Filter tokens based on various criteria:

```python
TokenFilter(
    min_market_cap=Decimal("10000"),          # Minimum market cap in USD
    max_market_cap=Decimal("1000000"),        # Maximum market cap in USD
    min_liquidity=Decimal("5000"),            # Minimum liquidity in USD
    min_volume_24h=Decimal("1000"),           # Minimum 24h volume in USD
    min_holder_count=10,                      # Minimum number of holders
    exchanges=["raydium", "orca"],            # Allowed exchanges
    symbols=["SOL", "USDC"],                  # Specific symbols to include
    exclude_symbols=["SCAM", "TEST"],         # Symbols to exclude
    max_risk_score=0.5,                       # Maximum risk score (0-1)
)
```

### DataExportConfig
Configure data export and storage:

```python
DataExportConfig(
    enabled=True,                             # Enable/disable export
    format="json",                            # "json", "csv", or "database"
    file_path="./exports",                    # Export directory
    max_file_size_mb=100,                     # File size limit for rotation
    rotation_interval_hours=24,               # Time-based rotation
    compress=True,                            # Enable compression
    include_metadata=True,                    # Include extra metadata
)
```

### AlertConfig
Set up alerts and notifications:

```python
AlertConfig(
    enabled=True,                             # Enable/disable alerts
    webhook_url="https://hooks.slack.com/...", # Webhook URL for notifications
    email="alerts@example.com",               # Email for alerts
    conditions=[                              # Custom alert conditions
        {
            "type": "new_pool",
            "min_liquidity": 100000,
            "description": "High liquidity pool alert"
        }
    ],
    rate_limit_seconds=300,                   # Minimum time between alerts
)
```

## ๐Ÿ“Š Monitoring and Statistics

Get real-time monitoring statistics:

```python
stats = client.get_monitoring_stats()

print(f"Total messages: {stats.total_messages:,}")
print(f"Messages per minute: {stats.messages_per_minute:.1f}")
print(f"Unique tokens seen: {stats.unique_tokens_seen}")
print(f"Unique pools seen: {stats.unique_pools_seen}")
print(f"Connection uptime: {stats.connection_uptime:.0f}s")
print(f"Error count: {stats.error_count}")
```

## ๐Ÿ“ Data Export Formats

### JSON Export
```json
{
    "timestamp": "2024-01-15T10:30:00",
    "channel": "new_pools",
    "data": {
        "c": "sol",
        "p": [{
            "a": "pool_address_here",
            "ba": "base_token_address", 
            "qa": "quote_token_address",
            "bti": {
                "s": "TOKEN",
                "n": "Token Name",
                "mc": 150000
            }
        }]
    }
}
```

### CSV Export
```csv
timestamp,channel,data
2024-01-15T10:30:00,new_pools,"{""c"":""sol"",""p"":[...]}"
```

### SQLite Database
Tables: `messages`, `new_pools`, `trades` with structured data storage.

## ๐Ÿšจ Error Handling

GmGnAPI provides comprehensive error handling:

```python
from gmgnapi import (
    GmGnAPIError,
    ConnectionError,
    AuthenticationError,
    SubscriptionError,
    MessageParsingError,
)

try:
    await client.connect()
    await client.subscribe_wallet_trades()
except AuthenticationError:
    print("Invalid access token")
except ConnectionError:
    print("Failed to connect to WebSocket")
except SubscriptionError as e:
    print(f"Subscription failed: {e}")
except GmGnAPIError as e:
    print(f"API error: {e}")
```

## ๐Ÿ“š Examples

The `examples/` directory contains comprehensive examples:

- **`basic_usage.py`**: Simple connection and data streaming
- **`advanced_monitoring.py`**: Full-featured monitoring with statistics
- **`data_export.py`**: Data export in multiple formats
- **`filtering_alerts.py`**: Advanced filtering and alerting
- **`multiple_channels.py`**: Subscribe to multiple data channels

## ๐Ÿงช Testing

Run the test suite:

```bash
# Install test dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run with coverage
pytest --cov=gmgnapi

# Run specific test file
pytest tests/test_client.py
```

## ๐Ÿ› ๏ธ Development

### Code Quality
```bash
# Format code
black src/ tests/ examples/

# Sort imports  
isort src/ tests/ examples/

# Type checking
mypy src/

# Linting
flake8 src/ tests/
```

### Building Documentation
```bash
# Install docs dependencies
pip install -e ".[docs]"

# Build docs
cd docs/
make html
```

## ๐Ÿค Contributing

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Make your changes
4. Add tests for new functionality
5. Ensure all tests pass (`pytest`)
6. Format your code (`black`, `isort`)
7. Commit your changes (`git commit -m 'Add amazing feature'`)
8. Push to the branch (`git push origin feature/amazing-feature`)
9. Open a Pull Request

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## ๐Ÿ™ Acknowledgments

- [GMGN.ai](https://gmgn.ai/) for providing the WebSocket API
- [Pydantic](https://pydantic-docs.helpmanual.io/) for data validation
- [websockets](https://websockets.readthedocs.io/) for WebSocket client implementation

## ๐Ÿ”— Links

- **Documentation**: [https://gmgnapi.readthedocs.io/](https://gmgnapi.readthedocs.io/)
- **PyPI Package**: [https://pypi.org/project/gmgnapi/](https://pypi.org/project/gmgnapi/)
- **GitHub Issues**: [https://github.com/yourusername/gmgnapi/issues](https://github.com/yourusername/gmgnapi/issues)
- **GMGN.ai**: [https://gmgn.ai/](https://gmgn.ai/)

---

**โšก Built for speed, designed for reliability, crafted for the Solana ecosystem.**

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "gmgnapi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "GmGnAPI Team <contact@gmgnapi.dev>",
    "keywords": "gmgn, gmgn-api, solana, blockchain, websocket, crypto, defi, trading, api, real-time, data, cryptocurrency, api-client, streaming",
    "author": null,
    "author_email": "GmGnAPI Team <contact@gmgnapi.dev>",
    "download_url": "https://files.pythonhosted.org/packages/db/c3/0be10c89332e561e15c1ce85acd8cab070977b4fbfc54da1720a3113c9c0/gmgnapi-0.1.0.tar.gz",
    "platform": null,
    "description": "# GmGnAPI\n\n**Professional Python client library for GMGN.ai WebSocket API**\n\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Discord](https://img.shields.io/discord/YOUR_DISCORD_ID?color=7289da&label=Discord&logo=discord&logoColor=white)](https://discord.gg/ub46R9Dk)\n\nGmGnAPI provides real-time access to Solana blockchain data through GMGN.ai's WebSocket API with advanced features including intelligent filtering, data export capabilities, monitoring statistics, and automated alerting.\n\n## \ud83d\udd17 Quick Links\n\n- \ud83d\udcda **[Documentation](https://yourusername.github.io/GmGnAPI/)** - Complete guides and API reference\n- \ud83d\udcac **[Discord Community](https://discord.gg/ub46R9Dk)** - Get help and discuss strategies\n- \ud83c\udf10 **[Create GMGN Account](https://gmgn.ai/?ref=9dLKvFyE&chain=sol)** - Sign up with our referral link to support the project\n\n## \ud83d\ude80 Features\n\n### Core Functionality\n- **Real-time WebSocket connection** to GMGN.ai API\n- **Multiple data channels**: New pools, token launches, pair updates, chain statistics, social info, wallet trades, limit orders\n- **Automatic reconnection** with exponential backoff\n- **Comprehensive error handling** and logging\n- **Type-safe** with full Pydantic model validation\n- **Async/await** support for modern Python applications\n\n### Advanced Features\n- **\ud83d\udd0d Intelligent Filtering**: Advanced token filtering by market cap, liquidity, volume, holder count, exchange, and risk scores\n- **\ud83d\udcca Data Export**: Export to JSON, CSV, or SQLite database with automatic file rotation and compression\n- **\ud83d\udcc8 Monitoring & Statistics**: Real-time connection metrics, message counts, unique token/pool tracking\n- **\ud83d\udea8 Alert System**: Configurable alerts for market conditions with rate limiting and webhook support\n- **\u26a1 Rate Limiting**: Configurable message processing limits to prevent overwhelming\n- **\ud83d\udd04 Queue Management**: Buffered message processing with configurable queue sizes\n\n## \ud83d\udce6 Installation\n\n```bash\npip install gmgnapi\n```\n\n### Development Installation\n\n```bash\ngit clone https://github.com/yourusername/gmgnapi.git\ncd gmgnapi\npip install -e .\n```\n\n## \ud83d\udd11 Account Setup\n\n### 1. Create GMGN Account\nCreate your GMGN account using our referral link to support the project:\n\ud83d\udc49 **[Create GMGN Account](https://gmgn.ai/?ref=9dLKvFyE&chain=sol)**\n\n### 2. Get API Token\n1. Log in to your GMGN account\n2. Navigate to Account Settings\n3. Generate an API token\n4. Copy and securely store your token\n\n### 3. Join Community\nJoin our Discord server for support and updates:\n\ud83d\udc49 **[Discord Community](https://discord.gg/ub46R9Dk)**\n\n## \ud83c\udfaf Quick Start\n\n### Basic Usage\n\n```python\nimport asyncio\nfrom gmgnapi import GmGnClient\n\nasync def on_new_pool(pool_info):\n    if pool_info.pools:\n        pool = pool_info.pools[0]\n        token_info = pool.bti\n        if token_info:\n            print(f\"New pool: {token_info.s} ({token_info.n})\")\n\nasync def main():\n    client = GmGnClient()\n    client.on_new_pool(on_new_pool)\n    \n    await client.connect()\n    await client.subscribe_new_pools()\n    \n    # Keep running\n    while True:\n        await asyncio.sleep(1)\n\nasyncio.run(main())\n```\n\n### Advanced Usage with Filtering and Export\n\n```python\nimport asyncio\nfrom decimal import Decimal\nfrom gmgnapi import (\n    GmGnEnhancedClient, \n    TokenFilter, \n    DataExportConfig,\n    AlertConfig\n)\n\nasync def main():\n    # Configure advanced token filtering\n    token_filter = TokenFilter(\n        min_market_cap=Decimal(\"50000\"),       # $50k minimum market cap\n        min_liquidity=Decimal(\"10000\"),        # $10k minimum liquidity\n        min_volume_24h=Decimal(\"5000\"),        # $5k minimum daily volume\n        min_holder_count=10,                   # 10+ holders\n        exchanges=[\"raydium\", \"orca\"],         # Specific exchanges only\n        exclude_symbols=[\"SCAM\", \"TEST\"],      # Exclude potential scams\n        max_risk_score=0.7,                    # Maximum risk threshold\n    )\n    \n    # Configure data export\n    export_config = DataExportConfig(\n        enabled=True,\n        format=\"json\",                         # \"json\", \"csv\", or \"database\"\n        file_path=\"./gmgn_data\",              # Export directory\n        max_file_size_mb=50,                  # File rotation at 50MB\n        rotation_interval_hours=6,            # Rotate every 6 hours\n        compress=True,                        # Enable compression\n    )\n    \n    # Configure alerts\n    alert_config = AlertConfig(\n        enabled=True,\n        webhook_url=\"https://hooks.slack.com/...\",  # Optional webhook\n        conditions=[\n            {\n                \"type\": \"high_value_pool\",\n                \"min_market_cap\": 100000,\n                \"description\": \"Alert for pools > $100k\"\n            }\n        ],\n        rate_limit_seconds=300,               # Max 1 alert per 5 minutes\n    )\n    \n    # Initialize enhanced client\n    client = GmGnEnhancedClient(\n        token_filter=token_filter,\n        export_config=export_config,\n        alert_config=alert_config,\n        rate_limit=100,                       # Max 100 messages/second\n    )\n    \n    # Event handlers\n    async def on_new_pool(pool_info):\n        if pool_info.pools:\n            pool = pool_info.pools[0]\n            token_info = pool.bti\n            if token_info:\n                print(f\"\ud83d\udd25 Filtered pool: {token_info.s} - ${token_info.mc:,}\")\n    \n    async def on_volume_spike(pair_data):\n        if pair_data.volume_24h_usd > Decimal(\"500000\"):\n            print(f\"\ud83d\udcc8 Volume spike: ${pair_data.volume_24h_usd:,}\")\n    \n    client.on_new_pool(on_new_pool)\n    client.on_pair_update(on_volume_spike)\n    \n    # Connect and subscribe\n    await client.connect()\n    await client.subscribe_all_channels()\n    \n    # Monitor and get statistics\n    while True:\n        await asyncio.sleep(60)\n        \n        stats = client.get_monitoring_stats()\n        print(f\"\ud83d\udcca Stats: {stats.total_messages:,} messages, \"\n              f\"{stats.unique_tokens_seen} tokens, \"\n              f\"{stats.unique_pools_seen} pools\")\n\nasyncio.run(main())\n```\n\n## \ud83d\udccb Available Channels\n\n### Public Channels\n- **`new_pools`**: New liquidity pool creation events\n- **`pair_update`**: Trading pair price and volume updates  \n- **`token_launch`**: New token launch notifications\n- **`chain_stats`**: Blockchain statistics and metrics\n\n### Authenticated Channels (require access token)\n- **`token_social`**: Token social media and community information\n- **`wallet_trades`**: Wallet trading activity and transactions\n- **`limit_orders`**: Limit order updates and fills\n\n## \ud83d\udd27 Configuration Options\n\n### TokenFilter\nFilter tokens based on various criteria:\n\n```python\nTokenFilter(\n    min_market_cap=Decimal(\"10000\"),          # Minimum market cap in USD\n    max_market_cap=Decimal(\"1000000\"),        # Maximum market cap in USD\n    min_liquidity=Decimal(\"5000\"),            # Minimum liquidity in USD\n    min_volume_24h=Decimal(\"1000\"),           # Minimum 24h volume in USD\n    min_holder_count=10,                      # Minimum number of holders\n    exchanges=[\"raydium\", \"orca\"],            # Allowed exchanges\n    symbols=[\"SOL\", \"USDC\"],                  # Specific symbols to include\n    exclude_symbols=[\"SCAM\", \"TEST\"],         # Symbols to exclude\n    max_risk_score=0.5,                       # Maximum risk score (0-1)\n)\n```\n\n### DataExportConfig\nConfigure data export and storage:\n\n```python\nDataExportConfig(\n    enabled=True,                             # Enable/disable export\n    format=\"json\",                            # \"json\", \"csv\", or \"database\"\n    file_path=\"./exports\",                    # Export directory\n    max_file_size_mb=100,                     # File size limit for rotation\n    rotation_interval_hours=24,               # Time-based rotation\n    compress=True,                            # Enable compression\n    include_metadata=True,                    # Include extra metadata\n)\n```\n\n### AlertConfig\nSet up alerts and notifications:\n\n```python\nAlertConfig(\n    enabled=True,                             # Enable/disable alerts\n    webhook_url=\"https://hooks.slack.com/...\", # Webhook URL for notifications\n    email=\"alerts@example.com\",               # Email for alerts\n    conditions=[                              # Custom alert conditions\n        {\n            \"type\": \"new_pool\",\n            \"min_liquidity\": 100000,\n            \"description\": \"High liquidity pool alert\"\n        }\n    ],\n    rate_limit_seconds=300,                   # Minimum time between alerts\n)\n```\n\n## \ud83d\udcca Monitoring and Statistics\n\nGet real-time monitoring statistics:\n\n```python\nstats = client.get_monitoring_stats()\n\nprint(f\"Total messages: {stats.total_messages:,}\")\nprint(f\"Messages per minute: {stats.messages_per_minute:.1f}\")\nprint(f\"Unique tokens seen: {stats.unique_tokens_seen}\")\nprint(f\"Unique pools seen: {stats.unique_pools_seen}\")\nprint(f\"Connection uptime: {stats.connection_uptime:.0f}s\")\nprint(f\"Error count: {stats.error_count}\")\n```\n\n## \ud83d\udcc1 Data Export Formats\n\n### JSON Export\n```json\n{\n    \"timestamp\": \"2024-01-15T10:30:00\",\n    \"channel\": \"new_pools\",\n    \"data\": {\n        \"c\": \"sol\",\n        \"p\": [{\n            \"a\": \"pool_address_here\",\n            \"ba\": \"base_token_address\", \n            \"qa\": \"quote_token_address\",\n            \"bti\": {\n                \"s\": \"TOKEN\",\n                \"n\": \"Token Name\",\n                \"mc\": 150000\n            }\n        }]\n    }\n}\n```\n\n### CSV Export\n```csv\ntimestamp,channel,data\n2024-01-15T10:30:00,new_pools,\"{\"\"c\"\":\"\"sol\"\",\"\"p\"\":[...]}\"\n```\n\n### SQLite Database\nTables: `messages`, `new_pools`, `trades` with structured data storage.\n\n## \ud83d\udea8 Error Handling\n\nGmGnAPI provides comprehensive error handling:\n\n```python\nfrom gmgnapi import (\n    GmGnAPIError,\n    ConnectionError,\n    AuthenticationError,\n    SubscriptionError,\n    MessageParsingError,\n)\n\ntry:\n    await client.connect()\n    await client.subscribe_wallet_trades()\nexcept AuthenticationError:\n    print(\"Invalid access token\")\nexcept ConnectionError:\n    print(\"Failed to connect to WebSocket\")\nexcept SubscriptionError as e:\n    print(f\"Subscription failed: {e}\")\nexcept GmGnAPIError as e:\n    print(f\"API error: {e}\")\n```\n\n## \ud83d\udcda Examples\n\nThe `examples/` directory contains comprehensive examples:\n\n- **`basic_usage.py`**: Simple connection and data streaming\n- **`advanced_monitoring.py`**: Full-featured monitoring with statistics\n- **`data_export.py`**: Data export in multiple formats\n- **`filtering_alerts.py`**: Advanced filtering and alerting\n- **`multiple_channels.py`**: Subscribe to multiple data channels\n\n## \ud83e\uddea Testing\n\nRun the test suite:\n\n```bash\n# Install test dependencies\npip install -e \".[dev]\"\n\n# Run tests\npytest\n\n# Run with coverage\npytest --cov=gmgnapi\n\n# Run specific test file\npytest tests/test_client.py\n```\n\n## \ud83d\udee0\ufe0f Development\n\n### Code Quality\n```bash\n# Format code\nblack src/ tests/ examples/\n\n# Sort imports  \nisort src/ tests/ examples/\n\n# Type checking\nmypy src/\n\n# Linting\nflake8 src/ tests/\n```\n\n### Building Documentation\n```bash\n# Install docs dependencies\npip install -e \".[docs]\"\n\n# Build docs\ncd docs/\nmake html\n```\n\n## \ud83e\udd1d Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Make your changes\n4. Add tests for new functionality\n5. Ensure all tests pass (`pytest`)\n6. Format your code (`black`, `isort`)\n7. Commit your changes (`git commit -m 'Add amazing feature'`)\n8. Push to the branch (`git push origin feature/amazing-feature`)\n9. Open a Pull Request\n\n## \ud83d\udcc4 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## \ud83d\ude4f Acknowledgments\n\n- [GMGN.ai](https://gmgn.ai/) for providing the WebSocket API\n- [Pydantic](https://pydantic-docs.helpmanual.io/) for data validation\n- [websockets](https://websockets.readthedocs.io/) for WebSocket client implementation\n\n## \ud83d\udd17 Links\n\n- **Documentation**: [https://gmgnapi.readthedocs.io/](https://gmgnapi.readthedocs.io/)\n- **PyPI Package**: [https://pypi.org/project/gmgnapi/](https://pypi.org/project/gmgnapi/)\n- **GitHub Issues**: [https://github.com/yourusername/gmgnapi/issues](https://github.com/yourusername/gmgnapi/issues)\n- **GMGN.ai**: [https://gmgn.ai/](https://gmgn.ai/)\n\n---\n\n**\u26a1 Built for speed, designed for reliability, crafted for the Solana ecosystem.**\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Professional Python client for GMGN.ai WebSocket API - Real-time Solana blockchain data streams",
    "version": "0.1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/theshadow76/GmGnAPI/issues",
        "Changelog": "https://github.com/theshadow76/GmGnAPI/releases",
        "Discussions": "https://github.com/theshadow76/GmGnAPI/discussions",
        "Documentation": "https://theshadow76.github.io/GmGnAPI/",
        "Homepage": "https://github.com/theshadow76/GmGnAPI",
        "Repository": "https://github.com/theshadow76/GmGnAPI.git"
    },
    "split_keywords": [
        "gmgn",
        " gmgn-api",
        " solana",
        " blockchain",
        " websocket",
        " crypto",
        " defi",
        " trading",
        " api",
        " real-time",
        " data",
        " cryptocurrency",
        " api-client",
        " streaming"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "aefe4659ff8da490519be50069d43c41323da062fc7cd05deefa6fc233ac0f2f",
                "md5": "cbb39b1492f18a31e56d0cb1e67236bb",
                "sha256": "8d43bd9a8849cafad4f8cb80d34df3a9169f024f187e65d48338a03611359e17"
            },
            "downloads": -1,
            "filename": "gmgnapi-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cbb39b1492f18a31e56d0cb1e67236bb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 21813,
            "upload_time": "2025-07-29T18:19:23",
            "upload_time_iso_8601": "2025-07-29T18:19:23.693617Z",
            "url": "https://files.pythonhosted.org/packages/ae/fe/4659ff8da490519be50069d43c41323da062fc7cd05deefa6fc233ac0f2f/gmgnapi-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "dbc30be10c89332e561e15c1ce85acd8cab070977b4fbfc54da1720a3113c9c0",
                "md5": "756ec491ffe074a21787bd37344ca3ca",
                "sha256": "84091c5e0e1efeaf04c58a1c58d5db8ef9c1ee82ee43cba9bcf4f821c3c5ef6d"
            },
            "downloads": -1,
            "filename": "gmgnapi-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "756ec491ffe074a21787bd37344ca3ca",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 26933,
            "upload_time": "2025-07-29T18:19:25",
            "upload_time_iso_8601": "2025-07-29T18:19:25.623754Z",
            "url": "https://files.pythonhosted.org/packages/db/c3/0be10c89332e561e15c1ce85acd8cab070977b4fbfc54da1720a3113c9c0/gmgnapi-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-29 18:19:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "theshadow76",
    "github_project": "GmGnAPI",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "pytest",
            "specs": [
                [
                    ">=",
                    "7.0.0"
                ]
            ]
        },
        {
            "name": "pytest-asyncio",
            "specs": [
                [
                    ">=",
                    "0.21.0"
                ]
            ]
        },
        {
            "name": "pytest-cov",
            "specs": [
                [
                    ">=",
                    "4.0.0"
                ]
            ]
        },
        {
            "name": "black",
            "specs": [
                [
                    ">=",
                    "23.0.0"
                ]
            ]
        },
        {
            "name": "isort",
            "specs": [
                [
                    ">=",
                    "5.12.0"
                ]
            ]
        },
        {
            "name": "flake8",
            "specs": [
                [
                    ">=",
                    "6.0.0"
                ]
            ]
        },
        {
            "name": "mypy",
            "specs": [
                [
                    ">=",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "pre-commit",
            "specs": [
                [
                    ">=",
                    "3.0.0"
                ]
            ]
        },
        {
            "name": "websockets",
            "specs": [
                [
                    ">=",
                    "11.0"
                ]
            ]
        },
        {
            "name": "aiohttp",
            "specs": [
                [
                    ">=",
                    "3.8.0"
                ]
            ]
        },
        {
            "name": "pydantic",
            "specs": [
                [
                    ">=",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "python-dateutil",
            "specs": [
                [
                    ">=",
                    "2.8.0"
                ]
            ]
        }
    ],
    "lcname": "gmgnapi"
}
        
Elapsed time: 0.80404s