Skip to main content

Fully async and parallel file upload/download in Telethon, without blocking the event loop.

Project description

AIOFastTelethonHelper

Asynchronous fork of FastTelethonhelper
Provides fully async and parallel file upload/download functions using aiofiles and non-blocking I/O.

📦 Installation

pip install aiofasttelethonhelper

⚙️ Usage Example

from aiofasttelethonhelper.utils import print_progress_bar
from aiofasttelethonhelper import fast_download, fast_upload
from telethon import TelegramClient

client = TelegramClient("session", API_ID, API_HASH)

def custom_progress_callback(**kwargs):
  done, total = kwargs.get('done'), kwargs.get('total')
  print(f"{done}/{total}")

async def main():
  async with client:
      file_path = await fast_download(
        client=client, 
        message=message, 
        file_path="./downloads", # or ./downloads/file.txt
        progress_callback=print_progress_bar
      )

      file = await fast_upload(
        client=client,
        file_path="input.txt",
        progress_callback=custom_progress_callback
      )
      await client.send_file("me", file)

❤️ Credits

  • Tulir Asokan - Original parallel transfer logic in mautrix-telegram
  • MiyukiKun - Original helper creator
  • Lonami - Creator of the amazing Telethon library

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiofasttelethonhelper-0.1.2.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiofasttelethonhelper-0.1.2-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file aiofasttelethonhelper-0.1.2.tar.gz.

File metadata

  • Download URL: aiofasttelethonhelper-0.1.2.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aiofasttelethonhelper-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8e250e42faf3a5c951c6d5d82fa929402e75c5b306f62cef710fee1cf72481f7
MD5 d2b9929c954f0d2b9ef19a64c8c54644
BLAKE2b-256 361eb3cd9bf2b5e57f8934e52def91fde3a93227ec2cee782abb1b5cb1081109

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiofasttelethonhelper-0.1.2.tar.gz:

Publisher: python-publish.yml on aron1cx/AIOFastTelethonHelper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aiofasttelethonhelper-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for aiofasttelethonhelper-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f61810a514fc8034c8c9380f6b2301e21e0fc1ac5fda3376bc0365dfa3901833
MD5 dbae0fa6e7bfa851682e7a8b136b86d9
BLAKE2b-256 a419418bf98e574b10c85bfeef2048128e21cc421a0b6161faeed1520fec49bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiofasttelethonhelper-0.1.2-py3-none-any.whl:

Publisher: python-publish.yml on aron1cx/AIOFastTelethonHelper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page