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 (recommended):

pip install rocketchat_API

From source:

git clone https://github.com/jadolg/rocketchat_API.git
cd rocketchat_API
pip install .

Requirements

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)

Token-Based Authentication

If you already have a user ID and authentication token, you can use them directly:

from rocketchat_API.rocketchat import RocketChat

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

rocket.me()

Method Parameters

Only required parameters are explicitly defined in the RocketChat class methods. However, you can pass any additional parameters supported by the Rocket.Chat API. For a complete list of available parameters, refer to the official Rocket.Chat API documentation.

Development

Setting Up the Development Environment

  1. Clone the repository:
git clone https://github.com/jadolg/rocketchat_API.git
cd rocketchat_API
  1. Install development dependencies:
pip install -e ".[test]"

Running Tests

Tests run against a Rocket.Chat instance in Docker. Make sure you have Docker and Docker Compose installed.

  1. Start the test server:
docker compose up -d
  1. Wait for Rocket.Chat to be ready:
until curl --silent http://localhost:3000/api/info/; do sleep 15; echo "waiting for Rocket.Chat server to start"; done
  1. Run the tests:
pytest
  1. To run tests with coverage:
pytest --cov=rocketchat_API
  1. When finished, stop the test server:
docker compose down

Code Style

This project uses black for code formatting. All code must be formatted with black before submitting a pull request.

To format your code:

black .

To check if your code is properly formatted:

black --check --diff .

The CI pipeline will automatically reject pull requests that are not properly formatted.

Contributing

See CONTRIBUTING.md for guidelines on how to contribute to this project.

License

This project is licensed under the MIT License. See LICENSE.txt for details.

Metadata

Release files for rocketchat-API 3.7.1

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 3.7.1
File Size Uploaded
rocketchat_api-3.7.1.tar.gz 91.6 kB Details

Built distribution (wheel)

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

Total release size: 122.2 kB

Release files / rocketchat_api-3.7.1.tar.gz

Download URL rocketchat_api-3.7.1.tar.gz
Size 91.6 kB
Tags Source
SHA-256 checksum
How to use checksums
915e7eeeddcdca02601fe06e4fbc596f45a5d366a71c72f3fb48f6103708696c
BLAKE2b-256 checksum
How to use checksums
fd31440f15fe378aa3f14b11bde8b6db3c1922e6a2a7d3a9089afc9ae1c73f85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 8, 2026.

Transparency log

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

Download URL rocketchat_api-3.7.1-py3-none-any.whl
Size 30.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad07005312a7f68572960c4768a9a7b9512a4f60c83d15273f5917bf655d49a1
BLAKE2b-256 checksum
How to use checksums
7b049f8e28e558e013c760f7d4e1b40ba540119cbfbf338fee9f0a6736fa6350
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.7.1 This release

2 release files

3.7.0

2 release files

3.6.1

2 release files

3.6.0

2 release files

3.5.0

2 release files

3.4.0

2 release files

3.3.0

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.36.0

2 release files

1.35.2

2 release files

1.35.1

2 release files

1.35.0

2 release files

1.32.0

2 release files

1.30.0

2 release files

1.28.1

2 release files

1.24.0

2 release files

1.23.2

2 release files

1.23.0

2 release files

1.22.0

2 release files

1.21.0

2 release files

1.15.0

2 release files

1.14.0

2 release files

1.13.0

2 release files

1.12.1

2 release files

1.12.0

2 release files

1.11.0

2 release files

1.10.1

2 release files

1.9.1

1 release file

1.8.0

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5

2 release files

1.4

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.6.36

2 release files

0.6.35

2 release files

0.6.34

2 release files

0.6.33

2 release files

0.6.32

2 release files

0.6.31

2 release files

0.6.27

2 release files

0.6.25

2 release files

0.6.24

2 release files

0.6.23

2 release files

0.6.22

2 release files

0.6.21

2 release files

0.6.20

2 release files

0.6.17

2 release files

0.6.16

2 release files

0.6.15

2 release files

0.6.14

2 release files

0.6.13

2 release files

0.6.12

2 release files

0.6.11

1 release file

0.6.10

1 release file

0.6.9

1 release file

0.6.8

1 release file

0.6.7

1 release file

0.6.6

1 release file

0.6.5

1 release file

0.6.4

1 release file

0.6.3

2 release files

0.6.2

3 release files

0.6.1

1 release file

0.6

2 release files

0.5.1

2 release files

0.4.2

2 release files

0.4.1

1 release file

0.4

1 release file

0.3.1

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

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