Skip to main content

Soroush Plus library for Python

Project description

SPlusthon is an asyncio Python 3 MTProto library to interact with Soroush Plus’s API as a user or through a bot account (bot API alternative).

SPlusthon is a fork of Telethon adapted to work with the Soroush Plus messenger. It uses Soroush-specific TL schema (layer 182), DC routing, RSA keys, and WebSocket transport.

What is this?

Soroush Plus is a popular messaging application. This library is meant to make it easy for you to write Python programs that can interact with Soroush Plus. Think of it as a wrapper that has already done the heavy job for you, so you can focus on developing an application.

Installing

pip3 install splusthon

Creating a client

SPlusthon includes default API credentials for Soroush Plus, so you can create a client without obtaining your own keys:

from splusthon import SoroushClient, events, sync
from splusthon.sessions import StringSession

# No api_id or api_hash needed - defaults are included
client = SoroushClient(StringSession(), session_string=None)
client.start()

Doing stuff

print(client.get_me().stringify())

client.send_message('username', 'Hello! Talking to you from SPlusthon')
client.send_file('username', '/home/myself/Pictures/holidays.jpg')

client.download_profile_photo('me')
messages = client.get_messages('username')
messages[0].download_media()

@client.on(events.NewMessage(pattern='(?i)hi|hello'))
async def handler(event):
    await event.respond('Hey!')

Using an existing session

If you have a saved session string, you can restore it:

from splusthon import SoroushClient
from splusthon.sessions import StringSession

session_string = '1AwA...'  # from a previous run
with SoroushClient(StringSession(session_string)) as client:
    print(client.get_me())

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

splusthon-1.0.6.tar.gz (571.4 kB view details)

Uploaded Source

Built Distribution

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

splusthon-1.0.6-py3-none-any.whl (646.7 kB view details)

Uploaded Python 3

File details

Details for the file splusthon-1.0.6.tar.gz.

File metadata

  • Download URL: splusthon-1.0.6.tar.gz
  • Upload date:
  • Size: 571.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for splusthon-1.0.6.tar.gz
Algorithm Hash digest
SHA256 2c03cdead6edcc3fcf47516cc494fa5649e7bcd1cc9b334ec21f0f87c58cd58b
MD5 19eaf35bce2ed7c1abc4edf5df1a29e0
BLAKE2b-256 ca51992dd4c2df5d551b73fccf3ecf4407f9d66c2637a108a6109bea1fda32b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for splusthon-1.0.6.tar.gz:

Publisher: python-publish.yml on shayanheidari01/SPlusthon

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

File details

Details for the file splusthon-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: splusthon-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 646.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for splusthon-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 6204d4fefa713f319e06e2429402b42f30eef4eec32b3a6eacd5ee73e41b4235
MD5 61908e0bc9a5a730d6489aa7d844ae01
BLAKE2b-256 d8e0ceb7a90f49555bd985c73049617f9b754b70d5375e6c4f888e035f87c2cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for splusthon-1.0.6-py3-none-any.whl:

Publisher: python-publish.yml on shayanheidari01/SPlusthon

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