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.1.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.1-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiofasttelethonhelper-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 5f9daca8a9aa7c03574ddcb95eb1108a1a47ab1bbb251e2493ca7d1c921ce5d1
MD5 08801df98584c35cd49ded7debbf18a4
BLAKE2b-256 988206f65129f67c0fb9f5666904c96ac5faba5da04869966fc1abe2b7de0dbf

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiofasttelethonhelper-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for aiofasttelethonhelper-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7d791b042e3e481fdd4dcbe363de8af801f8a0c92af3127a148fa6f25764f339
MD5 2eecab7119e19c7d16029f94417a6fa2
BLAKE2b-256 1493105f133d6047521e0f1859643de26f91e3be0a0bc924448ee4d5e92be872

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiofasttelethonhelper-0.1.1-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