Skip to main content

outlookの情報を取得するためのCLIツール

Project description

概要

Microsoft Outlook上のデータを取得するためのCLIツールです

機能

$ otlk --help

Usage: otlk [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  empty   対象ユーザー同士での共通した空き時間を取得
  event   対象ユーザーのイベントを取得
  me      自身のユーザー情報を表示
  people  ユーザー一覧をを表示
  • 細かなオプションは、それぞれのコマンドの--helpで確認のこと

自分のアカウントを確認

$ otlk me

|                | me                                   |
|:---------------|:-------------------------------------|
| id             | xxxx                                 |
| displayName    | hase hiro                            |
| user_id        | me                                   |
| mobilePhone    |                                      |
| officeLocation |                                      |
| mobilePhone    |                                      |

所属するグループのユーザーを確認

$ otlk people

|     | displayName                                                       | user_id                            | companyName      |
|----:|:------------------------------------------------------------------|:-----------------------------------|:-----------------|
|   0 | xxxx                                                              | xxx@exapmle.com                    |                  |
|   1 | yyyy                                                              | yyy@example.com                    | ABC              |
|   2 | zzzz                                                              |                                    |                  |

予定一覧を確認

$ otlk [ユーザー名]  --start [YYYY/mm/dd HH/MM] --end [YYYY/mm/dd HH/MM] 

|    | subject                                                                                  | locations            | start.dateTime      | end.dateTime        |
|---:|:-----------------------------------------------------------------------------------------|:---------------------|:--------------------|:--------------------|
|  0 | subjectA                                                                                 | []                   | 2020-03-02 18:00:00 | 2020-03-02 18:30:00 |
|  1 | subjectB                                                                                 | []                   | 2020-03-02 19:00:00 | 2020-03-02 20:00:00 |
...
  • -dオブションをつけることで、参加者一覧や、終日の予定かどうかなどの、付属情報も確認可能
  • ユーザー名を省略した場合、自身の予定が出力される
  • --start[end]の時間以下は省略可能。また、それぞれのオプションを省略した場合、直近の予定が出力される

指定したユーザー同士の空いている時間を確認

$ otlk empty [ユーザー名1] [ユーザー名2]  ... --minutes [確保したい時間(分) --start [YYYY/mm/dd HH/MM] --end [YYYY/mm/dd HH/MM] 

|    | from             | to               |
|---:|:-----------------|:-----------------|
|  0 | 2020/03/29 18:45 | 2020/03/30 10:00 |
|  1 | 2020/03/30 13:00 | 2020/03/30 13:30 |
|  2 | 2020/03/30 13:45 | 2020/03/30 16:00 |
|  3 | 2020/03/30 17:30 | 2020/03/30 18:00 |
  • --start[end]の時間以下は省略可能。また、それぞれのオプションを省略した場合、直近数日の予定が出力される

設定方法

インストール

pip install -U otlk

認証

[
    "openid",
    "offline_access",
    "User.Read",
    "Calendars.Read",
    "Calendars.Read.Shared",
    "People.Read"
]

credential.jsonを作成

上記の情報から、json形式のファイルを作成する

{
"client_id": "xxxx",
"client_secret": "yyyy",
"refresh_token": "zzzz"

}

環境変数の設定

上記のcredential.jsonのPATHを、以下の環境変数に設定

 export OTLK_CREDENTIAL="[path]/[to]/credential.json"

確認

下記のコマンドで、自身の情報が返ってくれば成功

otlk me

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

otlk-0.3.1.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

otlk-0.3.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file otlk-0.3.1.tar.gz.

File metadata

  • Download URL: otlk-0.3.1.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.3 CPython/3.8.0 Darwin/18.5.0

File hashes

Hashes for otlk-0.3.1.tar.gz
Algorithm Hash digest
SHA256 c624ef7057d80093f06ef952a197c264d8722e99be681f468b949c1d3ea356c0
MD5 d32010d8769b7db72ae34a7f4d1d0082
BLAKE2b-256 939580fd3717f2ddb94e770a49f6fbe13589deef8163c2865a147c523ee6d042

See more details on using hashes here.

File details

Details for the file otlk-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: otlk-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.3 CPython/3.8.0 Darwin/18.5.0

File hashes

Hashes for otlk-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0915d5e74b6c20e60f9fddb037333fcf17b1631716e7c1165b96b32ad6e7e1ce
MD5 b4450e2efad766526aceb90d5b1902fa
BLAKE2b-256 83dfb3bf33498d8dd186ee37c6cd1ee51aa1427e688c3a6dc2173d27081ecb61

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page