Python API wrapper for Rocket.Chat
Actively maintained. Last release 8 days ago, commits in 11 of the last 26 weeks. A safe choice.
pip install rocketchat-apirocketchat_API
Python API wrapper for Rocket.Chat
Installation
From PyPI (recommended):
pip install rocketchat_API
From source:
git clone https://github.com/jadolg/rocketchat_API.git
cd rocketchat_API
pip install .
Requirements
- Python 3.11 or higher
- requests
Compatibility
This library is tested against all supported versions of Python and Rocket.Chat. It is also continuously tested against the latest Rocket.Chat release to ensure compatibility with new versions.
We do not guarantee any compatibility outside of the tested versions.
See the Test GitHub Action to get the list of tested versions.
Usage
Basic Authentication
from rocketchat_API.rocketchat import RocketChat
rocket = RocketChat('user', 'pass', server_url='https://demo.rocket.chat')
# Get current user info
rocket.me()
# List all channels
for channel in rocket.channels_list():
print(channel.get("name"))
# Post a message
rocket.chat_post_message('good news everyone!', channel='GENERAL', alias='Farnsworth')
# Get channel history
rocket.channels_history('GENERAL', max_count=5)