rocketchat-API


Namerocketchat-API JSON
Version 1.31.0 PyPI version JSON
download
home_pagehttps://github.com/jadolg/rocketchat_API
SummaryPython API wrapper for Rocket.Chat
upload_time2023-11-04 17:25:29
maintainer
docs_urlNone
authorJorge Alberto Díaz Orozco
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
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 and publish](https://github.com/jadolg/rocketchat_API/workflows/Test%20and%20publish/badge.svg?branch=master) [![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://www.jetbrains.com/company/brand/img/logo6.svg) [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": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Jorge Alberto D\u00edaz Orozco",
    "author_email": "diazorozcoj@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/06/0f/1a5f67be5180cdf137e9b3a16c8d457055fdf98f8b051ac3a8c79f717186/rocketchat_API-1.31.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 and publish](https://github.com/jadolg/rocketchat_API/workflows/Test%20and%20publish/badge.svg?branch=master) [![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://www.jetbrains.com/company/brand/img/logo6.svg) [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.31.0",
    "project_urls": {
        "Homepage": "https://github.com/jadolg/rocketchat_API"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a95aaeac1f92a4d388900388de7fed77fe357638a28f6e7411e491bf61924f14",
                "md5": "f33df4a923ae8e736d03f80039906c98",
                "sha256": "85a7cbe497ba96da98957f894ab785e7f58b9284cc720952a003aabee5a68bbf"
            },
            "downloads": -1,
            "filename": "rocketchat_API-1.31.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f33df4a923ae8e736d03f80039906c98",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 21219,
            "upload_time": "2023-11-04T17:25:27",
            "upload_time_iso_8601": "2023-11-04T17:25:27.585610Z",
            "url": "https://files.pythonhosted.org/packages/a9/5a/aeac1f92a4d388900388de7fed77fe357638a28f6e7411e491bf61924f14/rocketchat_API-1.31.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "060f1a5f67be5180cdf137e9b3a16c8d457055fdf98f8b051ac3a8c79f717186",
                "md5": "c7e88f2428c1b85d76bee5eacafedbba",
                "sha256": "eb9660e0493fa57400282d381ebd196fe8747b5d58733c7edfecac6d6cd96164"
            },
            "downloads": -1,
            "filename": "rocketchat_API-1.31.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c7e88f2428c1b85d76bee5eacafedbba",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 15001,
            "upload_time": "2023-11-04T17:25:29",
            "upload_time_iso_8601": "2023-11-04T17:25:29.390455Z",
            "url": "https://files.pythonhosted.org/packages/06/0f/1a5f67be5180cdf137e9b3a16c8d457055fdf98f8b051ac3a8c79f717186/rocketchat_API-1.31.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-04 17:25:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jadolg",
    "github_project": "rocketchat_API",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "rocketchat-api"
}
        
Elapsed time: 0.14511s