Skip to main content
pyfragment

pyfragment

PyPI Downloads Python Tests License

Async Python client for the Fragment.com marketplace API.

Documentation · Examples

Disclaimer: This project is not affiliated with Fragment or Telegram.

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.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyfragment 2026.4.0
File Size Uploaded
pyfragment-2026.4.0.tar.gz 79.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyfragment 2026.4.0
File Interpreter ABI Platform
pyfragment-2026.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 131.0 kB

Release files / pyfragment-2026.4.0.tar.gz

Download URL pyfragment-2026.4.0.tar.gz
Size 79.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b1760e9e6143412a6566ff07952c6b849130d3b0c1f86c95690bffd9355da7d2
BLAKE2b-256 checksum
How to use checksums
f2854bc32f51a3ff8db169bd4cd78ac0e789d83aeaf68c6460a9f10fc0ab33ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 28, 2026.

Transparency log

Release files / pyfragment-2026.4.0-py3-none-any.whl

Download URL pyfragment-2026.4.0-py3-none-any.whl
Size 51.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4bf54d4f587775e35b528d799edc0de981239686b97e76aa2d6189250078a8d9
BLAKE2b-256 checksum
How to use checksums
416692ce4050331508004fab009c3bafaf09dee4dafc8a5310c3ab54f92e4a80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2026.4.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page