Metadata-Version: 2.4
Name: twgetter
Version: 0.1.0
Summary: Fetch Twitch streamer info via DecAPI
Author: sniman
License: MIT
Project-URL: Homepage, https://github.com/sniman/twgetter
Keywords: twitch,decapi,streamer
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27.0

# twgetter

Small Python library to fetch Twitch streamer info via [DecAPI](https://decapi.me).

## Install

```bash
# from project folder
pip install .

# or editable (for development)
pip install -e .
```

After publishing to PyPI:

```bash
pip install twgetter
```

## Usage

```python
import twgetter

streamer = twgetter.get_streamer("bratishkinoff")

print(streamer.nickname)
print(streamer.user_id)
print(streamer.avatar)
print(streamer.follow_count)
print(streamer.game)
print(streamer.title)
```

Or with a client instance:

```python
from twgetter import DecAPI

with DecAPI() as api:
    streamer = api.get_streamer("bratishkinoff")
    print(streamer.follow_count)
```

## Fields

| Field | Source |
|-------|--------|
| `nickname` | input login |
| `user_id` | `/twitch/id` |
| `avatar` | `/twitch/avatar` |
| `account_age` | `/twitch/accountage` |
| `creation` | `/twitch/creation` |
| `follow_count` | `/twitch/followcount` |
| `total_views` | `/twitch/total_views` |
| `game` | `/twitch/game` |
| `status` / `title` | `/twitch/status`, `/title` |
| `uptime` | `/twitch/uptime` |
| `viewer_count` | `/twitch/viewercount` |
| `highlight` | `/twitch/highlight` |
| `videos` | `/twitch/videos` |
| `vod_replay` | `/twitch/vod_replay` |
| `emotes` | `/twitch/emotes` |

## Note

DecAPI rate limit: **100 req/min** for `/twitch/*`.
