rocketchat-API


Namerocketchat-API JSON
Version 1.35.0 PyPI version JSON
download
home_pagehttps://github.com/jadolg/rocketchat_API
SummaryPython API wrapper for Rocket.Chat
upload_time2025-01-23 08:28:42
maintainerNone
docs_urlNone
authorJorge Alberto Díaz Orozco
requires_pythonNone
licenseMIT
keywords
VCS
bugtrack_url
requirements requests packaging
Travis-CI No Travis.
coveralls test coverage
            ## rocketchat_API
Python API wrapper for [Rocket.Chat](https://developer.rocket.chat/reference/api/rest-api/)

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/fff725d9a0974c6597c2dd007daaa86e)](https://www.codacy.com/app/jadolg/rocketchat_API?utm_source=github.com&utm_medium=referral&utm_content=jadolg/rocketchat_API&utm_campaign=Badge_Grade) [![Test](https://github.com/jadolg/rocketchat_API/actions/workflows/build.yml/badge.svg)](https://github.com/jadolg/rocketchat_API/actions/workflows/build.yml) [![codecov](https://codecov.io/gh/jadolg/rocketchat_API/branch/master/graph/badge.svg)](https://codecov.io/gh/jadolg/rocketchat_API) ![PyPI](https://img.shields.io/pypi/v/rocketchat_API.svg) ![](https://img.shields.io/pypi/dm/rocketchat-api.svg)

### Installation
- From pypi:
`pip3 install rocketchat_API`
- From GitHub:
Clone our repository and `python3 setup.py install`

### Requirements
- [requests](https://github.com/kennethreitz/requests)

### Usage
```python
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](https://github.com/kennethreitz/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.

```python
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

```python
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](https://developer.rocket.chat/reference/api/rest-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](https://open.rocket.chat/channel/python_rocketchat_api) if you want to talk.

### Supporters
![JetBrains](https://upload.wikimedia.org/wikipedia/en/thumb/0/08/JetBrains_beam_logo.svg/180px-JetBrains_beam_logo.svg.png) [JetBrains](https://www.jetbrains.com/) supports this project by providing us with licenses for their fantastic products.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jadolg/rocketchat_API",
    "name": "rocketchat-API",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Jorge Alberto D\u00edaz Orozco",
    "author_email": "diazorozcoj@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6d/d8/7d1314dd491783384eec2f49226566bc7a56222fb91381e3ead3fd449068/rocketchat_api-1.35.0.tar.gz",
    "platform": null,
    "description": "## rocketchat_API\nPython API wrapper for [Rocket.Chat](https://developer.rocket.chat/reference/api/rest-api/)\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/fff725d9a0974c6597c2dd007daaa86e)](https://www.codacy.com/app/jadolg/rocketchat_API?utm_source=github.com&utm_medium=referral&utm_content=jadolg/rocketchat_API&utm_campaign=Badge_Grade) [![Test](https://github.com/jadolg/rocketchat_API/actions/workflows/build.yml/badge.svg)](https://github.com/jadolg/rocketchat_API/actions/workflows/build.yml) [![codecov](https://codecov.io/gh/jadolg/rocketchat_API/branch/master/graph/badge.svg)](https://codecov.io/gh/jadolg/rocketchat_API) ![PyPI](https://img.shields.io/pypi/v/rocketchat_API.svg) ![](https://img.shields.io/pypi/dm/rocketchat-api.svg)\n\n### Installation\n- From pypi:\n`pip3 install rocketchat_API`\n- From GitHub:\nClone our repository and `python3 setup.py install`\n\n### Requirements\n- [requests](https://github.com/kennethreitz/requests)\n\n### Usage\n```python\nfrom pprint import pprint\nfrom rocketchat_API.rocketchat import RocketChat\n\nproxy_dict = {\n    \"http\"  : \"http://127.0.0.1:3128\",\n    \"https\" : \"https://127.0.0.1:3128\",\n}\n\nrocket = RocketChat('user', 'pass', server_url='https://demo.rocket.chat', proxies=proxy_dict)\npprint(rocket.me().json())\npprint(rocket.channels_list().json())\npprint(rocket.chat_post_message('good news everyone!', channel='GENERAL', alias='Farnsworth').json())\npprint(rocket.channels_history('GENERAL', count=5).json())\n```\n\n*note*: every method returns a [requests](https://github.com/kennethreitz/requests) Response object.\n\n#### Connection pooling\nIf 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.\n\n```python\nfrom requests import sessions\nfrom pprint import pprint\nfrom rocketchat_API.rocketchat import RocketChat\n\nwith sessions.Session() as session:\n    rocket = RocketChat('user', 'pass', server_url='https://demo.rocket.chat', session=session)\n    pprint(rocket.me().json())\n    pprint(rocket.channels_list().json())\n    pprint(rocket.chat_post_message('good news everyone!', channel='GENERAL', alias='Farnsworth').json())\n    pprint(rocket.channels_history('GENERAL', count=5).json())\n```\n\n#### Using a token for authentication instead of user and password\n\n```python\nfrom pprint import pprint\nfrom rocketchat_API.rocketchat import RocketChat\n\nrocket = RocketChat(user_id='WPXGmQ64S3BXdCRb6', auth_token='jvNyOYw2f0YKwtiFS06Fk21HBRBBuV7zI43HmkNzI_s', server_url='https://demo.rocket.chat')\npprint(rocket.me().json())\n```\n\n### Method parameters\nOnly 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](https://developer.rocket.chat/reference/api/rest-api)\n\n### API coverage\nMost of the API methods are already implemented. If you are interested in a specific call just open an issue or open a pull request.\n\n### Tests\nWe are actively testing :)\n\nTests run on a Rocket.Chat Docker container so install Docker and docker-compose.\n1. To start test server do `docker-compose up` and to take test server down `docker-compose down`\n2. To run the tests run `pytest`\n\n### Contributing\nYou 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.\n\nReporting bugs and asking for features is also contributing ;) Feel free to help us grow by registering issues.\n\nWe hang out [here](https://open.rocket.chat/channel/python_rocketchat_api) if you want to talk.\n\n### Supporters\n![JetBrains](https://upload.wikimedia.org/wikipedia/en/thumb/0/08/JetBrains_beam_logo.svg/180px-JetBrains_beam_logo.svg.png) [JetBrains](https://www.jetbrains.com/) supports this project by providing us with licenses for their fantastic products.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python API wrapper for Rocket.Chat",
    "version": "1.35.0",
    "project_urls": {
        "Homepage": "https://github.com/jadolg/rocketchat_API"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "be10c29c328b306b287d0c671906e71b9e692fea4a628ecae0be4d2ab9a78849",
                "md5": "d939222d4107c63471ca7cb1354d5346",
                "sha256": "b99c2b7d6730045a9c81be2bb206d9001190c0367035c95a62b7e0d7a4b4fa03"
            },
            "downloads": -1,
            "filename": "rocketchat_API-1.35.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d939222d4107c63471ca7cb1354d5346",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 22743,
            "upload_time": "2025-01-23T08:28:40",
            "upload_time_iso_8601": "2025-01-23T08:28:40.399459Z",
            "url": "https://files.pythonhosted.org/packages/be/10/c29c328b306b287d0c671906e71b9e692fea4a628ecae0be4d2ab9a78849/rocketchat_API-1.35.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6dd87d1314dd491783384eec2f49226566bc7a56222fb91381e3ead3fd449068",
                "md5": "3885a5e7db5ec9131169099a0cbad897",
                "sha256": "8755887760614124433eefedb64fb45d54c7832e1e721ca2e1702b93be215554"
            },
            "downloads": -1,
            "filename": "rocketchat_api-1.35.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3885a5e7db5ec9131169099a0cbad897",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 27488,
            "upload_time": "2025-01-23T08:28:42",
            "upload_time_iso_8601": "2025-01-23T08:28:42.422208Z",
            "url": "https://files.pythonhosted.org/packages/6d/d8/7d1314dd491783384eec2f49226566bc7a56222fb91381e3ead3fd449068/rocketchat_api-1.35.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-23 08:28:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jadolg",
    "github_project": "rocketchat_API",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.32.3"
                ]
            ]
        },
        {
            "name": "packaging",
            "specs": [
                [
                    "~=",
                    "24.2"
                ]
            ]
        }
    ],
    "lcname": "rocketchat-api"
}
        
Elapsed time: 1.32642s