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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spluspy-2.0.1.tar.gz.
File metadata
- Download URL: spluspy-2.0.1.tar.gz
- Upload date:
- Size: 587.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc806efc28364006753208d2ff4770ec3d3cfd09bfde1c3384eb9b2eb79031c9
|
|
| MD5 |
2fd5b242c74cdab9cd37fdc6306b4f41
|
|
| BLAKE2b-256 |
35a6cb7212583d0cedeb467239076ef20deab1479f73ea62661e5fad6bf8ae9f
|
File details
Details for the file spluspy-2.0.1-py3-none-any.whl.
File metadata
- Download URL: spluspy-2.0.1-py3-none-any.whl
- Upload date:
- Size: 661.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d70e8990a425fda4fc53364ff8a77b0d70761e83565d82c2ac70a8b09907cbb0
|
|
| MD5 |
5b6e0acc30ffcc38755e65bb0a252267
|
|
| BLAKE2b-256 |
616ef47fe567dcb3ae9bafbf0377652f9bd6d5ec2de33d32ee791c9620fadfcd
|