Python library for the Karaden API
Project description
Karaden Pythonライブラリ
Karaden Pythonライブラリは、Pythonで書かれたアプリケーションからKaraden APIへ簡単にアクセスするための手段を提供します。 それにはAPIレスポンスから動的に初期化するAPIリソースの一連のクラス定義が含まれているため、Karaden APIの幅広いバージョンと互換性があります。
インストール方法
パッケージを変更しないならば、このソースコードは必要ありません。 パッケージを使用したいだけならば、下記を実行するだけです。
pip install --upgrade karaden-prg-python
ソースコードからインストールしたいのであるならば、下記を実行します。
python setup.py install
動作環境
Python 3.7~3.10
使い方
このライブラリを使用するには、Karadenでテナントを作成し、プロジェクト毎に発行できるトークンを発行する必要があります。
作成したテナントID(テナントIDはテナント選択画面で表示されています)は、Config.tenant_idに、発行したトークンはConfig.api_keyにそれぞれ設定します。
from karaden.config import Config
from karaden.param.message_create_params import MessageCreateParams
from karaden.model.message import Message
Config.api_key = '<トークン>'
Config.tenant_id = '<テナントID>'
params = (
MessageCreateParams
.new_builder()
.with_service_id(1)
.with_to('09012345678')
.with_body('本文')
.build()
)
message = Message.create(params)
リクエスト毎の設定
同一のプロセスで複数のキーを使用する必要がある場合、リクエスト毎にキーやテナントIDを設定することができます。
params = (
MessageDetailParams
.new_builder()
.with_id('<メッセージID>')
.build()
)
request_options = (
RequestOptions.new_builder()
.with_api_key('<トークン>')
.with_tenant_id('<テナントID>')
.build()
)
message = Message.detail(params, request_options)
タイムアウトについて
通信をするファイルサイズや実行環境の通信速度によってはHTTP通信時にタイムアウトが発生する可能性があります。
何度も同じような現象が起こる際は、ファイルサイズの調整もしくはRequestOptionsからタイムアウトの時間を増やして、再度実行してください。
request_options = (
RequestOptions.new_builder()
.with_api_key('<トークン>')
.with_tenant_id('<テナントID>')
.with_connection_timeout(<秒>)
.with_read_timeout(<秒>)
.build()
)
bulk_message = BulkMessageService.create('<ファイルパス>', request_options)
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
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 karaden_prg_python-1.2.1.tar.gz.
File metadata
- Download URL: karaden_prg_python-1.2.1.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
686f9255fe5c2acfed7f91b25418a062aaa36e03d0e8039cb6cc6a72ef336d23
|
|
| MD5 |
d664c9b5ab4890ba5fb3804bcff390fe
|
|
| BLAKE2b-256 |
98fe9261387048f6cd67028222cf90113fc14c876fd68cc6bca18607b2da412b
|
Provenance
The following attestation bundles were made for karaden_prg_python-1.2.1.tar.gz:
Publisher:
release.yml on karaden-prg/karaden-prg-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
karaden_prg_python-1.2.1.tar.gz -
Subject digest:
686f9255fe5c2acfed7f91b25418a062aaa36e03d0e8039cb6cc6a72ef336d23 - Sigstore transparency entry: 840225759
- Sigstore integration time:
-
Permalink:
karaden-prg/karaden-prg-python@3e2c670b36e29003e443efd97be8749d8b6985bb -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/karaden-prg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3e2c670b36e29003e443efd97be8749d8b6985bb -
Trigger Event:
push
-
Statement type:
File details
Details for the file karaden_prg_python-1.2.1-py3-none-any.whl.
File metadata
- Download URL: karaden_prg_python-1.2.1-py3-none-any.whl
- Upload date:
- Size: 33.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f9a41e6af42bd41570da82244313ad8329323419ae77599ed82863b492a9773
|
|
| MD5 |
3f3168b50bc1d22cb9eda8889b06138a
|
|
| BLAKE2b-256 |
f1a3a88fee41c8fcfb20071001cc6f8ae312eea63a6d3e7454eb3c107b4c63da
|
Provenance
The following attestation bundles were made for karaden_prg_python-1.2.1-py3-none-any.whl:
Publisher:
release.yml on karaden-prg/karaden-prg-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
karaden_prg_python-1.2.1-py3-none-any.whl -
Subject digest:
4f9a41e6af42bd41570da82244313ad8329323419ae77599ed82863b492a9773 - Sigstore transparency entry: 840225797
- Sigstore integration time:
-
Permalink:
karaden-prg/karaden-prg-python@3e2c670b36e29003e443efd97be8749d8b6985bb -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/karaden-prg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3e2c670b36e29003e443efd97be8749d8b6985bb -
Trigger Event:
push
-
Statement type: