Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
karaden-prg-python
Readme
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)
FAQs
Python library for the Karaden API
We found that karaden-prg-python demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.