Metadata-Version: 2.4
Name: pygenezys
Version: 0.1.0
Summary: Add your description here
Author-email: Dorian Lamouille <dorianlamouille@gmail.com>
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: requests>=2.34.2
Description-Content-Type: text/markdown

# pygenezys

An unofficial Python client for [Genezys](https://app.genezys.xyz).

> **Disclaimer**: this is an unofficial, community-built client. It is not
> affiliated with, endorsed by, or supported by Genezys. It talks to
> undocumented, internal API endpoints, which may change or break without
> notice. Use of these endpoints may be subject to Genezys's Terms of
> Service — use at your own risk.

## Installation

```
pip install pygenezys
```

## Getting a token

`pygenezys` does not log in on your behalf — you provide your own session
token, the same one the website itself uses:

1. Log into [app.genezys.xyz](https://app.genezys.xyz) in your browser.
2. Open your browser's developer tools (F12) and go to the Network tab.
3. Reload the page and find any request to `app.genezys.xyz`.
4. Copy the value of the `Authorization` request header — that's your token.

This token is short-lived (roughly one hour). Once it expires, repeat the
steps above to get a new one and pass it to `set_token()` (see below)
instead of creating a new client.

## Quickstart

```python
from pygenezys import GenezysClient

client = GenezysClient("your-token-here")

print(client.user.get_username())
print(client.user.get_gnz())
print(client.cup.get_available_cups_id())
```

When your token expires, swap in a fresh one on the same client instead of
re-instantiating:

```python
client.set_token("your-new-token-here")
```

## Available resources

Each resource is namespaced on the client and mirrors a Genezys feature area:

| Resource | Examples |
|---|---|
| `client.user` | `get_username()`, `get_gnz()`, `get_gems()`, `get_user_id()` |
| `client.cup` | `get_available_cups_id()`, `get_available_cups_info()` |
| `client.arena` | `get_arena_info()` |
| `client.average_price` | `average_prices()` |
| `client.challenges` | `get_challenges_info()` |
| `client.deck` | `build_deck_division(card_info)`, `build_deck_commun_cup(card_info)`, etc. |
| `client.match` | `run_division_match()`, `run_cup_match(cup_id)` |
| `client.match_history` | `get_match_history(numberof_matches=10)` |
| `client.mission` | `get_missions()` |
| `client.my_cards` | `get_my_cards(order='desc', sortBy='baseScore', max_results=20)` |
| `client.market` | `get_market(order='desc', sortBy='date', max_results=20)` |
| `client.ranking` | `cup_leaderboard(cup_id, max_results=10)`, `division_leaderboard(max_results)` |
| `client.rewards` | `get_daily_rewards_info()`, `get_missions_info()` |
| `client.transaction_history` | `get_transaction_history(numberof_matches=10)` |

`client.deck.build_deck_*()` and `client.match.run_*_match()` mutate your
real account state (they change your live deck / queue a real match) — use
them deliberately, they make real action.

## Forms of answers

You can find every exemple of every json answers and their expected field in pygenezys/tests
/fixtures.

## License

MIT
