Metadata-Version: 2.1
Name: asiacellclient
Version: 1.0.0
Summary: Unofficial AsiaCell Python SDK
Author: KingZero
Author-email: KingZero@darksidehost.com
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: requests
Requires-Dist: fake_useragent

# AsiaCell SDK

A modern Python SDK for interacting with AsiaCell APIs.

## Features

- Token-based authentication
- Profile parsing
- Balance retrieval
- Voucher top-up
- Typed response models
- Session management
- Random User-Agent rotation
- Custom exceptions
- Lightweight and easy to use

---

# Installation

```bash
pip install asiacell
```

---

# Quick Start

```python
from asiacell import AsiaCellClient

client = AsiaCellClient(
    token="YOUR_TOKEN"
)

profile = client.get_profile()

print(profile.name)
print(profile.phone)
print(profile.balance.amount)
```

---

# Authentication

The SDK currently supports Bearer Token authentication.

```python
from asiacell import AsiaCellClient

client = AsiaCellClient(
    token="YOUR_JWT_TOKEN"
)
```

You can also set or clear the token later:

```python
client.set_token("TOKEN")

client.clear_token()
```

---

# Profile

Retrieve account profile information.

```python
profile = client.get_profile()

print(profile.name)
print(profile.phone)
print(profile.photo)
```

## Profile Object

```python
profile.name
profile.phone
profile.photo
profile.balance
```

---

# Balance

```python
balance = client.get_balance()

print(balance.amount)
```

---

# Voucher Top-Up

```python
result = client.topup(
    msisdn="077XXXXXXXX",
    voucher="1234567890"
)

print(result.success)
print(result.message)
```

## TopUpResult Object

```python
result.success
result.message
result.raw
```

---

# Random User-Agent Rotation

```python
client.rotate_user_agent()
```

---

# Exceptions

The SDK provides custom exceptions:

```python
from asiacell.exceptions import (
    AsiacellError,
    AuthenticationError,
    APIError,
    VoucherUsedError
)
```

Example:

```python
try:
    client.get_profile()

except AuthenticationError:
    print("Invalid token")

except APIError as e:
    print(e)
```

---

# Models

## Profile

```python
Profile(
    name: str,
    phone: str,
    photo: str,
    balance: Balance
)
```

## Balance

```python
Balance(
    amount: int
)
```

## TopUpResult

```python
TopUpResult(
    success: bool,
    message: str,
    raw: dict
)
```

---

# Example

```python
from asiacell import AsiaCellClient

client = AsiaCellClient(
    token="YOUR_TOKEN"
)

profile = client.get_profile()

print(profile.name)
print(profile.balance.amount)

result = client.topup(
    msisdn=profile.phone,
    voucher="1234567890"
)

print(result.message)
```

---

# Requirements

- Python 3.9+
- requests
- fake-useragent

---

# Legal Disclaimer

This project is an unofficial SDK and is not affiliated with or endorsed by AsiaCell.

Use responsibly and in compliance with applicable terms of service.

---

# License

MIT License
