PyDooray
PyDooray is a Python library to access the Dooray! REST API. This library enables you to access Dooray! services such as messenger, project, calendar, drive and wiki in your Python applications.
How to use
Messenger Hook
import dooray
MESSENGER_HOOK_URL = '<Your hook url>'
MESSENGER_HOOK_ICON_URL = '<Your hook icon url>'
hook = dooray.MessengerHook(MESSENGER_HOOK_URL, hook_name="My Bot", hook_icon=MESSENGER_HOOK_ICON_URL)
hook.send('Send text only')
attachments = [
{
"title": "title only",
},
{
"title": "title with link",
"titleLink": "http://dooray.com/",
"text": "green message box",
"color": "green"
},
]
hook.send('Send Text with attachments', attachments=attachments)
attachments = dooray.MessengerHookAttachments.builder()\
.add_attachment(title='title by builder', title_link= 'http://dooray.com/', text='text by builder', color='yellow')\
.add_attachment(text='text in purple box', color='purple')\
.create()
hook.send('Send Text with attachments builder', attachments=attachments)
Messenger
import dooray
DOORAY_API_TOKEN = '<Your Dooray! API Token>'
CHANNEL_TITLE = '<Channel Title>'
MEMBER_TO_INVITE = '<Email address of a member>'
d = dooray.Dooray(DOORAY_API_TOKEN)
member = d.get_members(external_emails=MEMBER_TO_INVITE)
member_id_list = [ member.result[0].id ]
channel = d.messenger.create_channel(CHANNEL_TITLE, member_id_list)
channel_id = channel.result.id
d.messenger.send_channel_message(channel_id, 'Send Message to Channel')
d.messenger.leave_channel(channel_id, member_id_list)
d.messenger.join_channel(channel_id, member_id_list)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
PyDooray-0.1.0.tar.gz
(6.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file PyDooray-0.1.0.tar.gz.
File metadata
- Download URL: PyDooray-0.1.0.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ab15425f96e0e52f78a5f1cd4548c3cd636feaaa73e5d17437f350219acf59b
|
|
| MD5 |
6185939db77c1b8a2354a9aeab7723ee
|
|
| BLAKE2b-256 |
5b888ae486b701bf48a1911cedb01a420b019351c4e978169001a935bee9df15
|
File details
Details for the file PyDooray-0.1.0-py3-none-any.whl.
File metadata
- Download URL: PyDooray-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fb157f48d0500a441db8b0ceb0eed31fcf4ab05e10f2c8de43ede025c3296e8
|
|
| MD5 |
bab9a1a539cc0521bfce5693d0bd3430
|
|
| BLAKE2b-256 |
296db7578f6122610d98f4b15f205c3d47f3f21f8f9c3b7ccc2f44172386c0b8
|