diff options
author | CoprDistGit <infra@openeuler.org> | 2023-04-10 21:26:41 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-04-10 21:26:41 +0000 |
commit | 610e613ab04b08092f935b1e513879a28db96ffb (patch) | |
tree | b4e4cd131b8a8bfb62b27380121c2e0ab79f2482 | |
parent | c5a59215e1c6e0b2c21e62edd06bc50469b38ab5 (diff) |
automatic import of python-rocketchat-api
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-rocketchat-api.spec | 317 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 319 insertions, 0 deletions
@@ -0,0 +1 @@ +/rocketchat_API-1.29.0.tar.gz diff --git a/python-rocketchat-api.spec b/python-rocketchat-api.spec new file mode 100644 index 0000000..170448e --- /dev/null +++ b/python-rocketchat-api.spec @@ -0,0 +1,317 @@ +%global _empty_manifest_terminate_build 0 +Name: python-rocketchat-API +Version: 1.29.0 +Release: 1 +Summary: Python API wrapper for Rocket.Chat +License: MIT +URL: https://github.com/jadolg/rocketchat_API +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/0c/9c/3cd35e2d523c6c926afc840626d4a7966bb5b00aff8d6d3fa1f5306d94e6/rocketchat_API-1.29.0.tar.gz +BuildArch: noarch + +Requires: python3-requests +Requires: python3-packaging + +%description +## rocketchat_API +Python API wrapper for [Rocket.Chat](https://developer.rocket.chat/reference/api/rest-api/) + +[](https://www.codacy.com/app/jadolg/rocketchat_API?utm_source=github.com&utm_medium=referral&utm_content=jadolg/rocketchat_API&utm_campaign=Badge_Grade)  [](https://codecov.io/gh/jadolg/rocketchat_API)   + +### 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/) supports this project by providing us with licenses for their fantastic products. + + +%package -n python3-rocketchat-API +Summary: Python API wrapper for Rocket.Chat +Provides: python-rocketchat-API +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-rocketchat-API +## rocketchat_API +Python API wrapper for [Rocket.Chat](https://developer.rocket.chat/reference/api/rest-api/) + +[](https://www.codacy.com/app/jadolg/rocketchat_API?utm_source=github.com&utm_medium=referral&utm_content=jadolg/rocketchat_API&utm_campaign=Badge_Grade)  [](https://codecov.io/gh/jadolg/rocketchat_API)   + +### 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/) supports this project by providing us with licenses for their fantastic products. + + +%package help +Summary: Development documents and examples for rocketchat-API +Provides: python3-rocketchat-API-doc +%description help +## rocketchat_API +Python API wrapper for [Rocket.Chat](https://developer.rocket.chat/reference/api/rest-api/) + +[](https://www.codacy.com/app/jadolg/rocketchat_API?utm_source=github.com&utm_medium=referral&utm_content=jadolg/rocketchat_API&utm_campaign=Badge_Grade)  [](https://codecov.io/gh/jadolg/rocketchat_API)   + +### 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/) supports this project by providing us with licenses for their fantastic products. + + +%prep +%autosetup -n rocketchat-API-1.29.0 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-rocketchat-API -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon Apr 10 2023 Python_Bot <Python_Bot@openeuler.org> - 1.29.0-1 +- Package Spec generated @@ -0,0 +1 @@ +2519c3476b31473c3cba7b0689b0f9b6 rocketchat_API-1.29.0.tar.gz |