Skip to main content

Session converter from Telethon session + json to Pyrogram and vice versa

PyPI version shields.io

Examples

From telethon to pylogram

import asyncio
import logging

from ks_session_manager.converter import Converter

API_ID = 123456
API_HASH = ""
PHONE_NUMBER = ""


async def main():
    converter = await Converter.from_telethon(PHONE_NUMBER, workdir="./telethon_sessions_path")

    try:
        await converter.export_pylogram_session()
    except FileExistsError as e:
        # Already exported
        logging.warning(e)

    client = await converter.get_pylogram_client()

    async with client:
        me = await client.get_me()
        print(me)


if __name__ == '__main__':
    logging.basicConfig(level=logging.INFO)
    asyncio.run(main())

Telethon sessions revision

import asyncio
import logging

from ks_session_manager.revisors import TelethonRevizor


async def main():
    revizor = TelethonRevizor(
        threads=20,  # How many revisions to run simultaneously
        dry_run=False  # If True, revisions will not actually connect to Telegram, only logs will be printed
    )
    await revizor.revise_all_in_path("./telethon_sessions_path", limit=20)


if __name__ == '__main__':
    logging.basicConfig(level=logging.INFO)
    asyncio.run(main())

Download files

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

Source Distribution

ks_session_manager-0.13.0.tar.gz (45.7 kB view details)

Uploaded Source

Built Distribution

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

ks_session_manager-0.13.0-py3-none-any.whl (55.2 kB view details)

Uploaded Python 3

File details

Details for the file ks_session_manager-0.13.0.tar.gz.

File metadata

  • Download URL: ks_session_manager-0.13.0.tar.gz
  • Upload date:
  • Size: 45.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ks_session_manager-0.13.0.tar.gz
Algorithm Hash digest
SHA256 665f987e806fdc128ed25a1b769f82fecb110c7dc62315659ac715f68cf323f9
MD5 d0170b3e5eb47cd5e583e168604227d8
BLAKE2b-256 fd6d29f6c6664760557ab0e1ca8c24203f9f6c80a41f073754470c09f9d63532

See more details on using hashes here.

File details

Details for the file ks_session_manager-0.13.0-py3-none-any.whl.

File metadata

  • Download URL: ks_session_manager-0.13.0-py3-none-any.whl
  • Upload date:
  • Size: 55.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ks_session_manager-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c33ef6d63999241f342250a8e541b02666ec0711b633ac45468472e884b35659
MD5 badbd1d687fafc70ec41d2f90110116c
BLAKE2b-256 1f80d70a8f28d72c00fddd74ed4a7eef49f53db10f839710402d02a6bb0855a1

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.13.0 This release

2 files

0.12.0

2 files

0.11.0

2 files

0.10.1

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.2

2 files

0.2.1

2 files

Supported by

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