Python client for the Fragment API
Project description
Fragment API Python Client
A Python client library for interacting with the Fragment API, which provides programmatic access to Telegram Stars, Premium, and TON services.
Installation
pip install starsgraceAPI
Usage
from fragment_api import FragmentAPI
# Initialize client
client = FragmentAPI()
# Create authentication session
auth_response = client.create_auth(
wallet_mnemonic="word1 word2 word3 ...",
cookies="cookie1=value1; cookie2=value2",
hash_value="121ff4016366e2a38f"
)
# Check balance
balance = client.get_balance()
# Buy stars
stars_response = client.buy_stars("@username", quantity=50, show_sender=False)
# Gift premium
premium_response = client.gift_premium("@username", months=3, show_sender=False)
# Top up TON
ton_response = client.topup_ton("@username", amount=1, show_sender=False)
# Search users
stars_user = client.get_user_stars("@username")
premium_user = client.get_user_premium("@username")
# Check API health
health = client.health_check()
# Close session
client.close()
Features
- Session management with persistent auth_key
- Support for all Fragment API endpoints
- Error handling for API responses
- Type hints for better code completion
- Clean and intuitive interface
Requirements
- Python 3.7+
- requests>=2.28.0
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
starsgraceapi-1.0.0.tar.gz
(5.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file starsgraceapi-1.0.0.tar.gz.
File metadata
- Download URL: starsgraceapi-1.0.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.12.1.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.32.5 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c02d6862d2e544caeef2df7c0a4d507fba6a7b5637ff08138ad6f225e44ed59
|
|
| MD5 |
d9f29806d9d5925a1e31cde1c0f7c39b
|
|
| BLAKE2b-256 |
04fccc3569b8f81bcf4e227347d4ca7f9ae02121fbe19a8059239886731c9b1c
|
File details
Details for the file starsgraceapi-1.0.0-py3-none-any.whl.
File metadata
- Download URL: starsgraceapi-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.12.1.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.32.5 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f232e9e1872fa9b3855d751f2cfcad30c9e93fdad3ed4304624bcc92a8c8f26f
|
|
| MD5 |
ba6b32ebb6765ee4365491fd5f3faa3e
|
|
| BLAKE2b-256 |
4d882c4eb1ee2d4c96f1e3f60b32f9045d5eeb8687b340129b0ac487fbb23a50
|