SferumAPI
SferumAPI — это Python-библиотека, предоставляющая удобный интерфейс для работы с закрытым API Сферума. Она упрощает выполнение рутинных задач и позволяет легко интегрировать функционал Сферума в ваши проекты.
Функционал
| Функция | Статус |
|---|---|
| 🔑 Авторизация пользователя в Сферуме | ✅ |
| 🔑 Авторизация сессии для звонков | ✅ |
| ✉️ Отправка сообщений пользователю | ✅ |
| 📥 Получение сообщений из чатов | ✅ |
| 📥 Получение сообщений из каналов | ✅ |
| 📞 Создание групповых звонков | ✅ |
| 🔗 Подключение к групповым звонкам | ❌ |
| 🛑 Завершение групповых звонков | ✅ |
| 📞 Создание личных звонков | ✅ |
| 🔗 Подключение к личным звонкам | ❌ |
| 🛑 Завершение личных звонков | ✅ |
| 📢 Отправка сообщений в каналы | ❓ |
✅ — Реализовано
❌ — В планах
❓ — Под вопросом
Зачем создана?
Каждую неделю приходится вручную выполнять норму по сообщениям и звонкам. Это рутинная и скучная задача, для которой не существовало готовых инструментов автоматизации. SferumAPI решает эту проблему, делая процесс быстрым и удобным.
Установка
Установите библиотеку через pip:
pip install SferumAPI
Или клонируйте репозиторий и установите её локально:
git clone https://github.com/l2700l/SferumAPI
cd SferumAPI
pip install .
Пример использования
import SferumAPI
# Инициализация
remixdsid = "" # значение берется из cookies
api = SferumAPI.SferumAPI(remixdsid=remixdsid)
# Получение историй сообщений
messages_history = api.messages.get_history(peer_id=0, count=1, offset=0) # peer_id - id чата в Сферум
print(messages_history.response.items[0].text)
channel_history = api.channels.get_history(channel_id=-1, count=1, offset=0)
print(channel_history.response.items[0].attachments[0].wall.attachments[0].photo.sizes[0].url)
# Звонки
api.calls.peer.set_peer_id(peer_id=0) # peer_id - id пользователя в Сферум
api.calls.peer.start()
input()
api.calls.peer.end()
# Отправка сообщения
api.messages.send_message(peer_id=0, text="SferumAPI") # peer_id - id пользователя в Сферум
Обратная связь и вклад в развитие
Если у вас есть предложения по улучшению или вы нашли ошибку, создайте issue в репозитории. Pull requests приветствуются!
Разработано с заботой о преподавателях и учителей ❤️
Metadata
Release files for SferumAPI 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sferumapi-0.1.1.tar.gz | 13.7 kB | Without provenance | Details for sferumapi-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| SferumAPI-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for SferumAPI-0.1.1-py3-none-any.whl |
Total release size: 36.9 kB
Release files / sferumapi-0.1.1.tar.gz
| Download URL | sferumapi-0.1.1.tar.gz |
|---|---|
| Size | 13.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea32ffef66c6e107a4da5db39506addff9ab645d839a79c87c51989e0d0d4df5
|
|
BLAKE2b-256 checksum How to use checksums |
ae527f5ba1c31c0e8740f3d6433c78f7680bc746947864bbeed3d1752c685db8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Release files / SferumAPI-0.1.1-py3-none-any.whl
| Download URL | SferumAPI-0.1.1-py3-none-any.whl |
|---|---|
| Size | 23.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c7969e905bfc0532fa1bb484c01a78656035787d82c998f5d296f0e3520223dc
|
|
BLAKE2b-256 checksum How to use checksums |
0fcfb5cd044505f4035e611be5b163ed87bed779ea71b023ad61d387987ece35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Security for SferumAPI 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.