Metadata-Version: 2.4
Name: funstat-api
Version: 0.1.0
Summary: Sync and async Python client for the Funstat API (Telegram user/group statistics)
Project-URL: Homepage, https://github.com/chizumeiji/funstat-api
Project-URL: Bug Tracker, https://github.com/chizumeiji/funstat-api/issues
Author-email: meiji <chizumeiji@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Мейджи
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: api,client,funstat,statistics,telegram
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: httpx>=0.24
Requires-Dist: pydantic>=2.0
Requires-Dist: requests>=2.28
Description-Content-Type: text/markdown

# funstat-api

Python client for the [Funstat](http://funstat.in/?start=0108FC1E9BEF75617466) API — Telegram user and group statistics.

Supports both **sync** and **async** usage.

## Installation

```bash
pip install funstat-api
```

## Quick Start

### Sync

```python
from funstat_api import FunstatClient

fs = FunstatClient("your_token")

# Get user stats
stats = fs.stats("durov")
print(stats.data.total_msg_count)

# Get group members
members = fs.get_group_members("https://t.me/mychat")

# Use as context manager
with FunstatClient("your_token") as fs:
    print(fs.ping())
```

### Async

```python
import asyncio
from funstat_api import AsyncFunstatClient

async def main():
    async with AsyncFunstatClient("your_token") as fs:
        stats = await fs.stats("durov")
        print(stats.data.total_msg_count)

asyncio.run(main())
```

## Available Methods

| Method | Description |
|--------|-------------|
| `ping()` | Check API availability and latency |
| `get_balance()` | Get current token balance |
| `resolve_username(username)` | Resolve username to user info |
| `basic_info_by_id(ids)` | Get basic info by user ID(s) |
| `stats_min(user)` | Get minimal user statistics |
| `stats(user)` | Get full user statistics |
| `messages_count(user)` | Get total message count |
| `groups_count(user)` | Get number of groups |
| `get_messages(user, ...)` | Get paginated message list |
| `get_chats(user)` | Get user's chat list |
| `get_names(user)` | Get name history |
| `get_usernames(user)` | Get username history |
| `get_stickers(user)` | Get used sticker packs |
| `get_gifts(user)` | Get gift relations |
| `common_groups(user)` | Get common groups stats |
| `username_usage(username)` | Who uses or used a username |
| `get_group_info(group)` | Get group/channel info |
| `get_group_members(group)` | Get group members |
| `search_text(query)` | Search messages by text |

`user` and `group` arguments accept: numeric ID, `@username`, or `https://t.me/...` link.

## Dependencies

- `pydantic >= 2.0`
- `requests >= 2.28` (sync client)
- `httpx >= 0.24` (async client)

## License

MIT