semvec/pypi-packages huggingface dataset:
pyrocketbot 1.0.5
Python lib for create rocketchat bot with getupdate like TelegramBots
Requires Python: >=3.9
Keywords: rocketchat,bot,rocket.chat

# RocketPyBot

## Python lib for create rocketchat bot with getupdate like TelegramBots
### This library is based on [rocketchat_API](https://github.com/jadolg/rocketchat_API)

### Installation

```bash
pip install pyrocketbot
```

### Usage

```python
import os
from pyrocketbot import RocketBot

username = os.environ.get('ROCKET_USERNAME')
password = os.environ.get('ROCKET_PASSWORD')
server_url = os.environ.get('ROCKET_SERVER_URL')

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

bot = RocketBot(username, password, server_url)
# bot = RocketBot(username, password, server_url, proxy_dict=proxy_dict)


@bot.command(r'/start')
def start(message, match_list):
    bot.send_message(message['rid'], 'hi')

@bot.command(r'/echo (.*)')
def echo(message, match_list):
    bot.send_message(message['rid'], match_list[0])


if __name__ == '__main__':
    print('Bot started')
    bot.run(chat_type='d', sleep=0.5)
```

### Note : 
in run method you can set `chat_type` to 'd' for direct message or 'c' for channel message and set `sleep` for sleep time per update
libexcs 0.0.2
An exceptional library
Requires Python: >=3.9
Keywords: exception,exceptions

libexcs
=======

*"An exceptional library"*


Installing
~~~~~~~~~~

Just use pip:

::

   pip install libexcs


Usage
-----

::

   import datetime
   from libexcs import root

   print("# 1. Subclass, override '_template_' class attribute and define class annotations")

   class DerivedException(root.RootException):
       _template_ = "Having count={count} for owner={owner}"

       count: int
       owner: str
       extra: datetime.datetime

   print("# ----")

   ts = datetime.datetime.utcnow()
   try:
       print("# 2. Raise with kwargs matching the template field names")
       raise DerivedException(count=42,
                              owner="somebody",
                              extra=dict(timestamp=ts))
   except Exception as e:
       print("# ----")
       print("# 3. Play with raised exceptions")
       print(f"# Raised exception 'e': {e}")

       print(f">> e.count == {e.count}")
       print(f">> e.owner == {e.owner}")
       print(f">> e.extra == {e.extra}")

       r = repr(e)
       print(f">> Exception repr: {r}")
       print("# Reconstructing exception from repr...")
       e2 = eval(r)
       print("# Comparing attribute from original and reconstructed exceptions...")
       print(f">> {e2.count} == {e.count} : {e2.count == e.count}")

   print("# ----")
   print("# 4. See behaviour on incorrect usage")

   print("# You will receive TypeError on missing")
   try:
       raise DerivedException(count=42)
   except Exception as e:
       print(f">> {e!r}")


Running the tests
-----------------

Simply run tox:

::

   tox


Contributing
------------

Contact me through `Issues <https://gitlab.com/pyctrl/libexcs/-/issues>`__.

Versioning
----------

We use `SemVer <http://semver.org/>`__ for versioning. For the versions
available, see the `tags on this
repository <https://gitlab.com/pyctrl/libexcs/-/tags>`__.

Authors
-------

-  **Dima Burmistrov** - *Initial work* -
   `pyctrl <https://gitlab.com/pyctrl/>`__

*Special thanks to* `Eugene Frolov <https://github.com/phantomii/>`__ *for inspiration.*

License
-------

This project is licensed under the MIT/X11 License - see the
`LICENSE <https://gitlab.com/pyctrl/libexcs/-/blob/main/LICENSE>`__ file for details