Client library for docomo API written in Python.
Project description
Client library for docomo API written in Python.
https://dev.smt.docomo.ne.jp/?p=docs.index
Supported apis
Dialogue
Sample code
>>> from doco.client import Client
>>> c = Client(apikey='YOUR_API_KEY')
>>> res = c.send(utt='hello', apiname='Dialogue')
>>> print(res)
{"utt":"はろー","yomi":"はろー","mode":"dialog","da":"30","context":"7DGIKMpQDE0zrQrYFAMqdw"}
>>> print(c.last_response.status_code)
200
>>> print(c.last_response.headers)
{'Content-Length': '99', 'Connection': 'keep-alive', 'Content-Type': 'application/json;charset=UTF-8', 'Date': 'Wed, 17 Dec 2014 05:28:28 GMT', 'asyncServiceInvoke': 'false'}
Cli example
$ export DOCO_API_KEY="YOUR API KEY"
$ python examples/dialogue_cli.py -u こんにちは
'mode': 'dialog', 'utt': 'どうも', 'context': 'N1liohyhkp6K7M80KS3bwg', 'da': '0', 'yomi': 'どうも'}
Interactive shell mode
$ export DOCO_API_KEY="YOUR API KEY"
$ python examples/dialogue_cli.py -i
Welcome to docomo dialogue cli.
^D to exit.
>>> こんにちは
はろー
>>>
Shiritori mode
$ export DOCO_API_KEY="YOUR API KEY"
$ python examples/dialogue_cli.py -i -s
Welcome to docomo dialogue cli.
^D to exit.
>>> しりとり
リング
>>> グッズ
頭痛
>>> 海
道のり
>>> リンゴ
ゴリラ
>>> ラッパ
パスポート
>>>
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
doco-0.0.5.tar.gz
(5.7 kB
view details)
File details
Details for the file doco-0.0.5.tar.gz
.
File metadata
- Download URL: doco-0.0.5.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef116e99c63a4de10447e8a8e507f8ba7a6114d139de112dede5e54ad3a8721d |
|
MD5 | d36fd50c4d936634e9890ed1df884998 |
|
BLAKE2b-256 | 850de5348ff3b0769481d55889d81046a4bad6243b52b8aff02ac2776ee9b447 |