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

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiofasttelethonhelper-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 001e2e46c75af5f6aaba5423a5ed01ec9b89c6de5a6e0d92456b3adf01c9981b
MD5 6c942dc79c2e2a5c4fe420268314e883
BLAKE2b-256 ba0e1a86728691f50c4bb413e43357f95ab86f9318e755dd4485c930f7103f9f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for aiofasttelethonhelper-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 379e8319dbc019f70b676be54cc70c37ca8a4b5e6235738887d9e530be960a9d
MD5 a419279f0e1dc6524631b1b5e3c3ad8e
BLAKE2b-256 dfcbe7853eed81bc67b19caa78a4863896308df35965785f36db8731f14401cf

See more details on using hashes here.

Provenance

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