What is this
This is a client for kokoro.io which is a chat service (maybe going to be) best ever.
I know that you want to join as soon as possible, please ask me or supermomonga-san about how to create account.
Requirements
Python3.6+
kokoro.io account(using your access token)
Install
$ pip install kokoroio
Configure
You must set an access token to sign in to kokoro.io by three way like follows.
Set environ path named KOKOROIO_ACCESS_TOKEN.
Set your access token to any file your choice and pass it’s file name to Kokoroio constructor as env_path.
Pass directly Kokoroio constructor as access_token.
Usage
Once you create Kokoroio instance, you can request from two way syncronous or asyncronous.
from kokoroio import Kokoroio
client = Kokoroio(access_token='xxxxxxx')
client.channels.get() # You received a response!
If an endpoint requires path parameters, you need to pass path parameters as arguments for request method.
# Assuming you want to post a message to channel whose channel_id is 'hogehoge'.
# In this case, url is `channels/hogehoge`.
o = client.channels.send_message(channle_id='hogehoge')
# So you can request with a payload.
o(message='hi')
And you can find every client’s methods.
clients.channels.method_names
clients.channels.methods
Syncronous request
You will get requests's HttpResponse object.
If you want to know about response object, please refer requests doc.
Example
client.channels.get()
Asyncronous request
Different from syncronous version, request method has a prefix like channels.aget() and you don’t need to create new event loop at every request.
You will get aiohttp's ClientResponse object because using aiohttp internally.
If you want to know about aiohttp, please refer aiohttp doc.
Example
client.channels.aget()
Test
Sorry now I have no test😭
About kokoro.io’s API detail
You can find all of current API detail from the official apidoc.
Metadata
Release files for kokoroio 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kokoroio-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for kokoroio-0.0.3-py3-none-any.whl |
Release files / kokoroio-0.0.3-py3-none-any.whl
| Download URL | kokoroio-0.0.3-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
458a132afd92238d44521509d554f9853ce968ef53072069037a03f10fc7f329
|
|
BLAKE2b-256 checksum How to use checksums |
2ad22a2a0879e6a558c53cf956459b88c6fd3027e99373626cce956effa0f044
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for kokoroio 0.0.3
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.