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
pip install asiacell
Quick Start
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.
from asiacell import AsiaCellClient
client = AsiaCellClient(
token="YOUR_JWT_TOKEN"
)
You can also set or clear the token later:
client.set_token("TOKEN")
client.clear_token()
Profile
Retrieve account profile information.
profile = client.get_profile()
print(profile.name)
print(profile.phone)
print(profile.photo)
Profile Object
profile.name
profile.phone
profile.photo
profile.balance
Balance
balance = client.get_balance()
print(balance.amount)
Voucher Top-Up
result = client.topup(
msisdn="077XXXXXXXX",
voucher="1234567890"
)
print(result.success)
print(result.message)
TopUpResult Object
result.success
result.message
result.raw
Random User-Agent Rotation
client.rotate_user_agent()
Exceptions
The SDK provides custom exceptions:
from asiacell.exceptions import (
AsiacellError,
AuthenticationError,
APIError,
VoucherUsedError
)
Example:
try:
client.get_profile()
except AuthenticationError:
print("Invalid token")
except APIError as e:
print(e)
Models
Profile
Profile(
name: str,
phone: str,
photo: str,
balance: Balance
)
Balance
Balance(
amount: int
)
TopUpResult
TopUpResult(
success: bool,
message: str,
raw: dict
)
Example
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
Metadata
Release files for asiacellclient 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| asiacellclient-1.0.0.tar.gz | 3.9 kB | Without provenance | Details for asiacellclient-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| asiacellclient-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for asiacellclient-1.0.0-py3-none-any.whl |
Total release size: 8.6 kB
Release files / asiacellclient-1.0.0.tar.gz
| Download URL | asiacellclient-1.0.0.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
23de866a68bd973c3bdeace0c8872dd8cc4ada253b47c2025f84b76a6151ef42
|
|
BLAKE2b-256 checksum How to use checksums |
e16af6541260446727cf38227b7a077c5b2c69de677e4ccbe7d3fe3d73c7e834
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.10
|
Release files / asiacellclient-1.0.0-py3-none-any.whl
| Download URL | asiacellclient-1.0.0-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9a7a36d862fbb725cae7188a3d704085c70e631d61bb35aa6307b7f8097d646b
|
|
BLAKE2b-256 checksum How to use checksums |
83f3eddd15f4efd0e905ea3ec244268f4ad1c3dd0b61bcea27fb52f23f8879e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.10
|
Security for asiacellclient 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.