Skip to main content

rocketchat_API

Python API wrapper for Rocket.Chat

Codacy Badge Test Test against latest Rocket.Chat version codecov PyPI

Installation

  • From pypi: pip3 install rocketchat_API
  • From GitHub: Clone our repository and python3 setup.py install

Requirements

Usage

from pprint import pprint
from rocketchat_API.rocketchat import RocketChat

proxy_dict = {
    "http"  : "http://127.0.0.1:3128",
    "https" : "https://127.0.0.1:3128",
}

rocket = RocketChat('user', 'pass', server_url='https://demo.rocket.chat', proxies=proxy_dict)
pprint(rocket.me().json())
pprint(rocket.channels_list().json())
pprint(rocket.chat_post_message('good news everyone!', channel='GENERAL', alias='Farnsworth').json())
pprint(rocket.channels_history('GENERAL', count=5).json())

note: every method returns a requests Response object.

Connection pooling

If you are going to make a couple of request, you can user connection pooling provided by requests. This will save significant time by avoiding re-negotiation of TLS (SSL) with the chat server on each call.

from requests import sessions
from pprint import pprint
from rocketchat_API.rocketchat import RocketChat

with sessions.Session() as session:
    rocket = RocketChat('user', 'pass', server_url='https://demo.rocket.chat', session=session)
    pprint(rocket.me().json())
    pprint(rocket.channels_list().json())
    pprint(rocket.chat_post_message('good news everyone!', channel='GENERAL', alias='Farnsworth').json())
    pprint(rocket.channels_history('GENERAL', count=5).json())

Using a token for authentication instead of user and password

from pprint import pprint
from rocketchat_API.rocketchat import RocketChat

rocket = RocketChat(user_id='WPXGmQ64S3BXdCRb6', auth_token='jvNyOYw2f0YKwtiFS06Fk21HBRBBuV7zI43HmkNzI_s', server_url='https://demo.rocket.chat')
pprint(rocket.me().json())

Method parameters

Only required parameters are explicit on the RocketChat class but you can still use all other parameters. For a detailed parameters list check the Rocket chat API

API coverage

Most of the API methods are already implemented. If you are interested in a specific call just open an issue or open a pull request.

Tests

We are actively testing :)

Tests run on a Rocket.Chat Docker container so install Docker and docker-compose.

  1. To start test server do docker-compose up and to take test server down docker-compose down
  2. To run the tests run pytest

Contributing

You can contribute by doing Pull Requests. (It may take a while to merge your code but if it's good it will be merged). Please, try to implement tests for all your code and use a PEP8 compliant code style.

Reporting bugs and asking for features is also contributing ;) Feel free to help us grow by registering issues.

We hang out here if you want to talk.

Supporters

JetBrains logo.

JetBrains supports this project by providing us with licenses for their fantastic products.

Metadata

Release files for rocketchat-API 1.35.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rocketchat-API 1.35.2
File Size Uploaded Provenance Actions
rocketchat_api-1.35.2.tar.gz 27.6 kB With provenance Details for rocketchat_api-1.35.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rocketchat-API 1.35.2
File Interpreter ABI Platform Actions
rocketchat_api-1.35.2-py3-none-any.whl Python 3 none any Details for rocketchat_api-1.35.2-py3-none-any.whl

Total release size: 50.3 kB

Release files / rocketchat_api-1.35.2.tar.gz

Download URL rocketchat_api-1.35.2.tar.gz
Size 27.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3c4d13141520eb205b7bef3e66842eb6bc7b20b7b48e6ba8515abeb614b8bd23
BLAKE2b-256 checksum
How to use checksums
a44dfa4efb6d69e2a909f37de8643d2de80cac6437821e803d53115c4449f016
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2025.

Transparency log

Release files / rocketchat_api-1.35.2-py3-none-any.whl

Download URL rocketchat_api-1.35.2-py3-none-any.whl
Size 22.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ced575f737c500c6621bd3dbf8ef8933e0a6556cae9b482ce31aa851c434e3c
BLAKE2b-256 checksum
How to use checksums
27ab209b45bd20241431b8ea93d1c8a3cd0ab70314956d225b13b812eb9f9f7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2025.

Transparency log

Security for rocketchat-API 1.35.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rocketchat_api-1.35.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2025.

Transparency log

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.

Release history Release notifications | RSS feed

This release

1.35.2 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page