pyryver
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 for the changelog.
Special thanks to @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.
More instructions can be found at Read the Docs.
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. 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.
If you want to see an example of pyryver being used in a real project, check out LaTeX Bot.
Here's an example demonstrating how to send a message (v0.4.0 API):
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):
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())
Metadata
Release files for pyryver 0.4.0.post1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pyryver-0.4.0.post1.tar.gz | 43.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyryver-0.4.0.post1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 89.4 kB
Release files / pyryver-0.4.0.post1.tar.gz
| Download URL | pyryver-0.4.0.post1.tar.gz |
|---|---|
| Size | 43.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
82cb291fe73a79231faf163af89f6cfc3d3c84c63330c9ec2f076c20d40bef78
|
|
BLAKE2b-256 checksum How to use checksums |
b83852c0da2e7499cbd49b55fa549527814fc12071b6661f1c80dd7286a9bfd1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.3
|
Release files / pyryver-0.4.0.post1-py3-none-any.whl
| Download URL | pyryver-0.4.0.post1-py3-none-any.whl |
|---|---|
| Size | 45.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d7f48103f0fa324b22857dc3b3c46a5a954e132991a6f2f2542dfb797865fb90
|
|
BLAKE2b-256 checksum How to use checksums |
571cc023bfce2de142402e9d3dee0b7744cc7a826f7e46808b14e072bf3305c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.3
|
Security for pyryver 0.4.0.post1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.