Skip to main content

Soroush Plus library for Python

Project description

SPlusPy is an asynchronous Python 3 MTProto library for interacting with the Soroush Plus platform as either a user account or a bot account (an alternative to the official Bot API).

Built as a fork of Telethon, SPlusPy has been adapted specifically for the Soroush Plus ecosystem. It supports the native Soroush Plus TL schema (Layer 182), DC routing, RSA encryption, and WebSocket transport, providing a modern and reliable developer experience.

Features

  • Fully asynchronous (asyncio)

  • User and bot account support

  • Native MTProto implementation

  • WebSocket transport

  • RSA encryption

  • Soroush Plus TL schema (Layer 182)

  • Based on the Telethon architecture

  • Modern Python 3 support

  • Convenience methods for sending files, photos, audio, video

  • Chat management: ban, unban, kick, pin/unpin messages

  • Admin and permissions management

  • High-performance encryption with optional cryptg support

What is SPlusPy?

Soroush Plus is a popular messaging platform.

SPlusPy provides a clean, Pythonic interface for communicating with the Soroush Plus MTProto API. Instead of implementing the protocol yourself, you can focus entirely on building your application while SPlusPy handles authentication, networking, serialization, and protocol details.

Installing

Install the latest version from PyPI:

pip install -U spluspy

For faster encryption (recommended):

pip install cryptg

Creating a client

SPlusPy includes the default Soroush Plus API credentials, so there is no need to obtain your own api_id or api_hash.

import asyncio
from spluspy import SoroushClient

bot = SoroushClient('my_bot')

@bot.on_message(incoming=True)
async def handler(event):
    if event.is_private and event.raw_text == 'Hello':
        await event.reply('Hi!')

async def main():
    await bot.start()
    print('Bot is running!')
    await bot.run_until_disconnected()

asyncio.run(main())

Quick Examples

Sending messages and files:

# Send a text message
await client.send_message('username', 'Hello!')

# Send a photo
await client.send_photo(chat, 'photo.jpg', caption='Check this out!')

# Send audio/music
await client.send_audio(chat, 'song.mp3')

# Send a video
await client.send_video(chat, 'video.mp4')

# Send a document
await client.send_document(chat, 'file.pdf')

Chat management:

# Ban a user
await client.ban_chat_member(chat, user)

# Unban a user
await client.unban_chat_member(chat, user)

# Pin a message
await client.pin_message(chat, message)

# Unpin all messages
await client.unpin_all_messages(chat)

Documentation

More examples and complete documentation will be available in future releases.

License

SPlusPy is open-source software distributed under its respective license.

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

spluspy-2.0.0.tar.gz (586.1 kB view details)

Uploaded Source

Built Distribution

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

spluspy-2.0.0-py3-none-any.whl (659.6 kB view details)

Uploaded Python 3

File details

Details for the file spluspy-2.0.0.tar.gz.

File metadata

  • Download URL: spluspy-2.0.0.tar.gz
  • Upload date:
  • Size: 586.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for spluspy-2.0.0.tar.gz
Algorithm Hash digest
SHA256 d9ae91173b2fdaf98eb1b210477e9c0468a5bd4b0afc02f4c029943b8e9a34fe
MD5 4ea68855d590a2e5c1720513f996caf4
BLAKE2b-256 6acfba11666d03b9e7fe77cf1910917f0df03496a5a10239c3e83bc4bca81e71

See more details on using hashes here.

File details

Details for the file spluspy-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: spluspy-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 659.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for spluspy-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73af3673d1671855afe35eef78ad513013188582d8b0bc180d334684fae9dcf0
MD5 77ad7323fd5fca88101194db03dd0fa1
BLAKE2b-256 6e0776864033f915e0a221043ef81a092afe23ffc8bb6a9a8266c5ae400b943e

See more details on using hashes here.

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