Skip to main content

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.

Install

$ pip install PyDooray

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)

Project

import dooray

DOORAY_API_TOKEN = '<Your Dooray! API Token>'
TO_MEMBER_ID = '<To Member ID>'
CC_MEMBER_ID = '<CC Member ID>'

d = dooray.Dooray(DOORAY_API_TOKEN)

project_name = f'PyDooray'
project_desc = f'Created by PyDooray > TestDoorayProject'
project_scope = 'private'
response = d.project.create(project_name, project_desc, project_scope)
project_id = response.result.id

post = dooray.PostBuilder()\
    .add_to_member(TO_MEMBER_ID)\
    .add_cc_member(CC_MEMBER_ID)\
    .set_subject(f'Test Subject')\
    .set_body(f'Test Body')\
    .create()

response = d.project.create_post(project_id, post)
post_id = response.result.id

d.project.create_post_log(project_id, post_id, 'Test Comment')

API Reference

See API Reference

Change Log

Version 0.2 (Jan/16/2022)

  • Add API wrappers for
    • Project > Projects
    • Project > Projects > EmailAddress
    • Project > Projects > Tags
    • Project > Projects > Milestones
    • Project > Projects > Hooks
    • Project > Projects > Members
    • Project > Projects > MemberGroups
    • Project > Projects > Template
    • Project > Projects > Posts
    • Project > Projects > Posts > Logs
  • Add ReadTheDocs documentation

Version 0.1 (Dec/02/2021)

  • Add API wrappers for
    • Common > Members
    • Messenger > Channels
    • Messenger Hook

Release files for PyDooray 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyDooray 0.2.0
File Size Uploaded
PyDooray-0.2.0.tar.gz 16.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PyDooray 0.2.0
File Interpreter ABI Platform
PyDooray-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 35.8 kB

Release files / PyDooray-0.2.0.tar.gz

Download URL PyDooray-0.2.0.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
45827cdb54f53c5a7abcfe724d5f857a832552ef812957a95332b0f6e043ff44
BLAKE2b-256 checksum
How to use checksums
b8bfca263ffe9b664394c329412a287e34a0d39edf60fdc517a62eb978a7a790
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

Release files / PyDooray-0.2.0-py3-none-any.whl

Download URL PyDooray-0.2.0-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58e45be3810dab8195316d99e491ff5cdd57444b2118b44e3a9a3e573e7107a7
BLAKE2b-256 checksum
How to use checksums
7432ef62dff55bcaa0e19e89daa63990fc1ad9de2548f1f0951d93414395f794
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page