pyfragment
Async Python client for Fragment.com — buy Telegram Stars, gift Premium, run giveaways, search the marketplace, and manage anonymous numbers, all from code.
Disclaimer: This project is not affiliated with Fragment or Telegram.
What you can do
- Stars — buy Stars for any Telegram user, run Stars giveaways for channels
- Premium — gift Telegram Premium subscriptions (3 / 6 / 12 months), run Premium giveaways
- Marketplace — search usernames, anonymous numbers and gifts; check live prices
- Wallet — check GRAM and USDT balances, top up GRAM for a user or recharge an Ads account
- Anonymous numbers — fetch login codes, toggle code reception, terminate active sessions
- Payments — GRAM (ex TON) and USDT-on-TON; every transfer signed once with your wallet key
Installation
pip install pyfragment
# Latest dev build
pip install git+https://github.com/bohd4nx/pyfragment.git@dev
Quick Start
import asyncio
from pyfragment import FragmentClient
from pyfragment.enums import PaymentMethod
async def main() -> None:
async with FragmentClient(
seed="word1 word2 ... word24",
api_key="YOUR_API_KEY",
cookies={"stel_ssid": "...", "stel_dt": "...", "stel_token": "...", "stel_ton_token": "..."},
) as client:
wallet = await client.get_wallet()
print("GRAM: %s | USDT: %s" % (wallet.gram_balance, wallet.usdt_balance))
stars = await client.purchase_stars("@username", amount=500, payment_method=PaymentMethod.USDT_GRAM)
print("Sent %s Stars to %s | tx: %s" % (stars.amount, stars.username, stars.transaction_id))
premium = await client.purchase_premium("@username", months=6, payment_method=PaymentMethod.GRAM)
print("Sent Premium %sm to %s | tx: %s" % (premium.amount, premium.username, premium.transaction_id))
asyncio.run(main())
Metadata
Release files for pyfragment 2026.5.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 |
|---|---|---|---|---|
| pyfragment-2026.5.0.tar.gz | 104.0 kB | With provenance | Details for pyfragment-2026.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyfragment-2026.5.0-py3-none-any.whl | Python 3 | none | any | Details for pyfragment-2026.5.0-py3-none-any.whl |
Total release size: 168.2 kB
Release files / pyfragment-2026.5.0.tar.gz
| Download URL | pyfragment-2026.5.0.tar.gz |
|---|---|
| Size | 104.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6101ee611722ca4542ee851e7abca917e26235d875ca518f0331a1ab21d056ae
|
|
BLAKE2b-256 checksum How to use checksums |
d375e41c35bbec6a3128077f16d1cf152a7b15e6e72ee90237d1643ecec27802
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.
Transparency logRelease files / pyfragment-2026.5.0-py3-none-any.whl
| Download URL | pyfragment-2026.5.0-py3-none-any.whl |
|---|---|
| Size | 64.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1443ea6eeb6233e1047a571b75f92c5a2f0e8ca7239ce45cf981523e5bdfce9c
|
|
BLAKE2b-256 checksum How to use checksums |
88ba31d07d1d1bbd891d9fe91b2d7bb448b15833d8d9d5792053a9ac34f70f72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.
Transparency logSecurity for pyfragment 2026.5.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pyfragment-2026.5.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.
Transparency logA 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.