pyryver


Namepyryver JSON
Version 0.4.0.post1 PyPI version JSON
download
home_pagehttps://github.com/tylertian123/pyryver
SummaryAn unofficial async Python library for Ryver.
upload_time2024-06-11 04:15:15
maintainerNone
docs_urlNone
authorTyler Tian, Matthew Mirvish
requires_python>=3.6
licenseNone
keywords ryver
VCS
bugtrack_url
requirements aiohttp
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyryver
![Python 3](https://img.shields.io/pypi/pyversions/pyryver)
[![MIT License](https://img.shields.io/pypi/l/pyryver)](https://github.com/tylertian123/pyryver/blob/master/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/pyryver)](https://pypi.org/project/pyryver/)
[![Read the Docs (latest)](https://img.shields.io/readthedocs/pyryver)](https://pyryver.readthedocs.io/en/latest/)
[![Read the Docs (stable)](https://img.shields.io/readthedocs/pyryver/stable?label=docs%20%28stable%29)](https://pyryver.readthedocs.io/en/stable/)

`pyryver` is an unofficial async Python library for Ryver.
It provides a simple and sane way of automating tasks on Ryver and building bots, without the need to set up Hubot or Botkit.

*`pyryver` is still in major version 0, so breaking changes may be introduced any time. Please check changelogs carefully.*
However, we will attempt to make it as backwards-compatible as possible (excluding version 0.1.0).

v0.4 is now out of beta! **Minor breaking changes were introduced since 0.3.2! See the [Release Description](https://github.com/tylertian123/pyryver/releases/tag/v0.4.0) for the changelog.**

Special thanks to [@mincrmatt12](https://github.com/mincrmatt12)!

## Installation
`pyryver` is now on PyPI! You can install it with `python3 -m pip install --user pyryver`.
You can also find pre-releases on [TestPyPI](https://test.pypi.org/project/pyryver/).
More instructions can be found at [Read the Docs](https://pyryver.readthedocs.io/en/latest/index.html).

`pyryver` requires Python >= 3.6 and the `aiohttp` library. 

## Supported Actions
`pyryver` has near complete support for every common Ryver action. 
This includes things like sending messages, uploading files, managing topics & tasks, creating forums/teams, etc.

`pyryver` currently does not support editing user and organization settings. 
Forum/team settings, however, are supported.

For a complete list of everything the API contains, head over to [the docs](https://pyryver.readthedocs.io/en/latest/index.html).
If there's something missing from the API that you'd like to see, create an issue and we'll get to it ASAP.

## Documentation and Examples
Documentation and examples can be found on [Read the Docs](https://pyryver.readthedocs.io).

If you want to see an example of `pyryver` being used in a real project, check out [LaTeX Bot](https://github.com/tylertian123/ryver-latexbot).

Here's an example demonstrating how to send a message (v0.4.0 API):
```py
import pyryver
import asyncio

async def main():
    # Connect to ryver
    async with pyryver.Ryver("my_organization", "my_username", "my_password") as ryver:
        # Load all chats
        await ryver.load_chats()
        # Find users and forums/teams
        friend = ryver.get_user(username="my_friend")
        forum_or_team = ryver.get_groupchat(name="My Forum or Team")
        # Send a message
        await friend.send_message("Hello, friend!")
        await forum_or_team.send_message("Hello, forum or team!")

asyncio.get_event_loop().run_until_complete(main())
```

Here's an example demonstrating how to get your bot to respond in real-time (v0.4.0 API):
```py
import pyryver
import asyncio

async def main():
    # Connect to ryver
    async with pyryver.Ryver("my_organization", "my_username", "my_password") as ryver:
        # Load all chats
        await ryver.load_chats()
        # Get the bot's user
        me = ryver.get_user(username="my_username")
        # Connect to the websocket interface
        # Enable auto-reconnects
        async with ryver.get_live_session(auto_reconnect=True) as session:
            @session.on_chat
            async def on_message(msg: pyryver.WSChatMessageData):
                print(msg.text) # print out the message's text
                # Reply to the message
                # Make sure to check that the message isn't from the bot itself
                if msg.from_jid != me.get_jid() and msg.text == "hello":
                    # Send a message to the same chat
                    # This could be either a user (for a private message) or a forum/team
                    chat = ryver.get_chat(jid=msg.to_jid)
                    await chat.send_message("hi")

            # run until session.terminate() is called
            await session.run_forever()

asyncio.get_event_loop().run_until_complete(main())
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/tylertian123/pyryver",
    "name": "pyryver",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "ryver",
    "author": "Tyler Tian, Matthew Mirvish",
    "author_email": "tylertian123@gmail.com, matthew@mm12.xyz",
    "download_url": "https://files.pythonhosted.org/packages/b8/38/52c0da2e7499cbd49b55fa549527814fc12071b6661f1c80dd7286a9bfd1/pyryver-0.4.0.post1.tar.gz",
    "platform": null,
    "description": "# pyryver\n![Python 3](https://img.shields.io/pypi/pyversions/pyryver)\n[![MIT License](https://img.shields.io/pypi/l/pyryver)](https://github.com/tylertian123/pyryver/blob/master/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/pyryver)](https://pypi.org/project/pyryver/)\n[![Read the Docs (latest)](https://img.shields.io/readthedocs/pyryver)](https://pyryver.readthedocs.io/en/latest/)\n[![Read the Docs (stable)](https://img.shields.io/readthedocs/pyryver/stable?label=docs%20%28stable%29)](https://pyryver.readthedocs.io/en/stable/)\n\n`pyryver` is an unofficial async Python library for Ryver.\nIt provides a simple and sane way of automating tasks on Ryver and building bots, without the need to set up Hubot or Botkit.\n\n*`pyryver` is still in major version 0, so breaking changes may be introduced any time. Please check changelogs carefully.*\nHowever, we will attempt to make it as backwards-compatible as possible (excluding version 0.1.0).\n\nv0.4 is now out of beta! **Minor breaking changes were introduced since 0.3.2! See the [Release Description](https://github.com/tylertian123/pyryver/releases/tag/v0.4.0) for the changelog.**\n\nSpecial thanks to [@mincrmatt12](https://github.com/mincrmatt12)!\n\n## Installation\n`pyryver` is now on PyPI! You can install it with `python3 -m pip install --user pyryver`.\nYou can also find pre-releases on [TestPyPI](https://test.pypi.org/project/pyryver/).\nMore instructions can be found at [Read the Docs](https://pyryver.readthedocs.io/en/latest/index.html).\n\n`pyryver` requires Python >= 3.6 and the `aiohttp` library. \n\n## Supported Actions\n`pyryver` has near complete support for every common Ryver action. \nThis includes things like sending messages, uploading files, managing topics & tasks, creating forums/teams, etc.\n\n`pyryver` currently does not support editing user and organization settings. \nForum/team settings, however, are supported.\n\nFor a complete list of everything the API contains, head over to [the docs](https://pyryver.readthedocs.io/en/latest/index.html).\nIf there's something missing from the API that you'd like to see, create an issue and we'll get to it ASAP.\n\n## Documentation and Examples\nDocumentation and examples can be found on [Read the Docs](https://pyryver.readthedocs.io).\n\nIf you want to see an example of `pyryver` being used in a real project, check out [LaTeX Bot](https://github.com/tylertian123/ryver-latexbot).\n\nHere's an example demonstrating how to send a message (v0.4.0 API):\n```py\nimport pyryver\nimport asyncio\n\nasync def main():\n    # Connect to ryver\n    async with pyryver.Ryver(\"my_organization\", \"my_username\", \"my_password\") as ryver:\n        # Load all chats\n        await ryver.load_chats()\n        # Find users and forums/teams\n        friend = ryver.get_user(username=\"my_friend\")\n        forum_or_team = ryver.get_groupchat(name=\"My Forum or Team\")\n        # Send a message\n        await friend.send_message(\"Hello, friend!\")\n        await forum_or_team.send_message(\"Hello, forum or team!\")\n\nasyncio.get_event_loop().run_until_complete(main())\n```\n\nHere's an example demonstrating how to get your bot to respond in real-time (v0.4.0 API):\n```py\nimport pyryver\nimport asyncio\n\nasync def main():\n    # Connect to ryver\n    async with pyryver.Ryver(\"my_organization\", \"my_username\", \"my_password\") as ryver:\n        # Load all chats\n        await ryver.load_chats()\n        # Get the bot's user\n        me = ryver.get_user(username=\"my_username\")\n        # Connect to the websocket interface\n        # Enable auto-reconnects\n        async with ryver.get_live_session(auto_reconnect=True) as session:\n            @session.on_chat\n            async def on_message(msg: pyryver.WSChatMessageData):\n                print(msg.text) # print out the message's text\n                # Reply to the message\n                # Make sure to check that the message isn't from the bot itself\n                if msg.from_jid != me.get_jid() and msg.text == \"hello\":\n                    # Send a message to the same chat\n                    # This could be either a user (for a private message) or a forum/team\n                    chat = ryver.get_chat(jid=msg.to_jid)\n                    await chat.send_message(\"hi\")\n\n            # run until session.terminate() is called\n            await session.run_forever()\n\nasyncio.get_event_loop().run_until_complete(main())\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "An unofficial async Python library for Ryver.",
    "version": "0.4.0.post1",
    "project_urls": {
        "Homepage": "https://github.com/tylertian123/pyryver"
    },
    "split_keywords": [
        "ryver"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "571cc023bfce2de142402e9d3dee0b7744cc7a826f7e46808b14e072bf3305c7",
                "md5": "7c7bf542a326a7aa2272371726eb7988",
                "sha256": "d7f48103f0fa324b22857dc3b3c46a5a954e132991a6f2f2542dfb797865fb90"
            },
            "downloads": -1,
            "filename": "pyryver-0.4.0.post1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7c7bf542a326a7aa2272371726eb7988",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 45521,
            "upload_time": "2024-06-11T04:15:13",
            "upload_time_iso_8601": "2024-06-11T04:15:13.413156Z",
            "url": "https://files.pythonhosted.org/packages/57/1c/c023bfce2de142402e9d3dee0b7744cc7a826f7e46808b14e072bf3305c7/pyryver-0.4.0.post1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b83852c0da2e7499cbd49b55fa549527814fc12071b6661f1c80dd7286a9bfd1",
                "md5": "24c1221e79c4e2a22540cba3f4eead79",
                "sha256": "82cb291fe73a79231faf163af89f6cfc3d3c84c63330c9ec2f076c20d40bef78"
            },
            "downloads": -1,
            "filename": "pyryver-0.4.0.post1.tar.gz",
            "has_sig": false,
            "md5_digest": "24c1221e79c4e2a22540cba3f4eead79",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 43832,
            "upload_time": "2024-06-11T04:15:15",
            "upload_time_iso_8601": "2024-06-11T04:15:15.258219Z",
            "url": "https://files.pythonhosted.org/packages/b8/38/52c0da2e7499cbd49b55fa549527814fc12071b6661f1c80dd7286a9bfd1/pyryver-0.4.0.post1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-11 04:15:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tylertian123",
    "github_project": "pyryver",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "aiohttp",
            "specs": []
        }
    ],
    "lcname": "pyryver"
}
        
Elapsed time: 4.42022s