RedStream
Асинхронный инструментарий для работы с Redis Streams и конфигурациями.
Описание
RedStream - это Python библиотека, которая предоставляет удобный интерфейс для работы с Redis Streams. Она разработана для создания масштабируемых микросервисных архитектур с использованием Redis в качестве шины обмена сообщениями.
Особенности
- Асинхронный API для работы с Redis Streams
- Система роутинга сообщений
- Работа с группами потребителей (Consumer Groups)
- Структуры сообщений с поддержкой типизации
- Отслеживание статусов сообщений в процессе обработки
- Интеграция с aiogram
Установка
pip install redstream
Простой пример использования
import asyncio
from redstream import RSMessage, RSMessageStatus, RedisStreamRouter
async def main():
# Инициализация роутера
router = RedisStreamRouter(
redis_url="redis://localhost:6379/0",
stream_name="my_stream"
)
# Создание сообщения
message = RSMessage(
event_type="message",
message_type="text",
action="process",
chat_id="123456",
user_id="user123",
text="Привет, RedStream!"
)
# Отправка сообщения
await router.publish_message("my_stream", message)
# Обработка сообщений
async def message_handler(msg):
print(f"Получено сообщение: {msg.text}")
return True
# Регистрация обработчика
router.register_handler("message", message_handler)
# Запуск обработки сообщений
await router.start_consuming()
if __name__ == "__main__":
asyncio.run(main())
Лицензия
MIT
Автор
Albert Toma (cornil@mail.ru)
Metadata
Release files for redstream 0.1.5
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 |
|---|---|---|---|---|
| redstream-0.1.5.tar.gz | 20.0 kB | Without provenance | Details for redstream-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| redstream-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for redstream-0.1.5-py3-none-any.whl |
Total release size: 44.1 kB
Release files / redstream-0.1.5.tar.gz
| Download URL | redstream-0.1.5.tar.gz |
|---|---|
| Size | 20.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
36c007b6af87cda505f7d5c9cffbac3880a2cb9fce426e8420ab03add479df2b
|
|
BLAKE2b-256 checksum How to use checksums |
6ba0e0575506a1b380fae0713259bc93b311b44f843ca00b726b4cdf91806e83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.10
|
Release files / redstream-0.1.5-py3-none-any.whl
| Download URL | redstream-0.1.5-py3-none-any.whl |
|---|---|
| Size | 24.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1282bc7766299e7f85912936fb4cd58b1939c86a5c90e9f6cd8375a061b998f9
|
|
BLAKE2b-256 checksum How to use checksums |
04b40096bb39847987f56735a91ea2c0197dede98cdfac41b693580ac81973b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.10
|
Security for redstream 0.1.5
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.