Kyasher
Kyash APIラッパー Python用
インストール
pip install kyasher
必須:requests, bs4, pkce
使い方
example.py
from Kyasher import Kyash
kyash = Kyash("メールアドレス","パスワード",proxy=None)#引数にプロキシを設定できる、proxy=dict
otp = input("OTP? :")#SMSに届いた6桁の認証番号
kyash.login(otp)
print(kyash.access_token)#有効期限は1ヶ月
print(kyash.client_uuid)
print(kyash.installation_uuid)#クライアントUUIDとインストレーションUUIDは2つで1セット
kyash = Kyash("メールアドレス","パスワード","登録済みクライアントUUID","登録済みインストレーションUUID")#これでログイン時のOTP認証をスキップできる
kyash = Kyash(access_token="アクセストークン")#またはトークンでログイン
profile = kyash.get_profile()#プロフィール取得
print(profile.username)#ユーザーネーム
print(profile.icon)#アイコン
print(profile.myouzi)#苗字
print(profile.namae)#名前
print(profile.phone)#電話番号
print(profile.is_kyc)#本人確認されているかどうか、True or False
wallet = kyash.get_wallet()#残高照会
print(wallet.uuid)#おさいふUUID
print(wallet.all_balance)#合計残高
print(wallet.money)#出金可能なキャッシュマネー
print(wallet.value)#出金不可のキャッシュバリュー
print(wallet.point)#ポイント
history = kyash.get_history(wallet_uuid=wallet.uuid,limit=3)#支出入の履歴を取得する、wallet_uuidを入力しなかったらその場で取得するので入力しなくてもOK
print(history.timelines)#リスト型、支出入履歴
summary = kyash.get_summary(year=2024,month=6)#支出入のカテゴリーを取得する、何も入力しないと今日の西暦と月になる
print(summary.summary)#↑で取得したレポート
create_link = kyash.create_link(amount=100,message="テストリンク",is_claim=False)#送金リンクを作成、is_claim=True で請求リンクを作成する
print(create_link.link)#↑で作ったリンク
link_info = kyash.link_check(create_link.link)#リンクを確認する、引数名はURLだけど https://kyash.me/payments/ はなくてもOK
print(link_info.amount)#金額
print(link_info.uuid)#リンクのUUID、必要
print(link_info.send_to_me)#受け取りリンクなら True、請求リンクなら False
print(link_info.public_id)#パブリックID、請求リンクにしか必要ない
print(link_info.sender_name)#リンク作成者のユーザーネーム
kyash.link_recieve(url="URL",link_uuid="リンクのUUID")#送金リンクを受け取る、引数はどちらか1つでOK、リンクのUUIDをいれるとリンクチェックがスキップされる
kyash.link_cancel(url="URL",link_uuid="リンクのUUID")#リンクをキャンセル、リンク受け取りと同じ
kyash.send_to_link(url="URL",message="Botが請求に応じました",link_info=link_info)#請求リンクに送金する時にリンクチェックをスキップしたい場合だけlink_info全体が必要、もちろんURLだけいれてもちゃんと機能する
#コメントで書いてあることが全部、それ以上は特にない...
もう少し知る
ログイン
ログイン時のワンタイムパスワードをスキップするためにはクライアントUUIDとインストレーションUUID両方が合っている必要がある
もちろんトークンがあればUUIDはテキトーでもOK
アクセストークンは1ヶ月経つと失効する
リンクチェック
なぜかKyashはリンクのID部分ではなくリンクUUIDが重要視されていてIDはほぼ完全に飾り
送金 / 請求URLにアクセスするとHTMLが返ってくるのでそこからリンクUUIDをスクレイピングしてる
json形式で返してくれるAPIもあったけどなぜかそれにもリンクUUIDが必要なためにけっきょくスクレイピングからは逃れられない
余談
ユーザーエージェントはiOS 16.7.5のiPhone8だけどトラフィックを確認した実機はiOS 14.8
Kyashが最近iOS 15のサポートを終了するって発表してたけど、僕は永遠にiOS 14
iOSは2,3年落ちになっただけでいろんなアプリに対応を切られてサイドローディングもろくにできないから寿命が短い (+インストールしたことのないアプリはAppStore++でも使わない限り過去バージョンをダウンロードできないから余計に)
Androidなんかがんばればロリポップですらまだ使えるのに (32bitはそろそろちょっときついかなぁ)
コンタクト
Discord サーバー / https://discord.gg/aSyaAK7Ktm
Discord ユーザー名 / .taka.
Metadata
Release files for kyasher 1.5.0
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 |
|---|---|---|---|---|
| kyasher-1.5.0-py3-none-any.whl | Python 3 | none | any | Details for kyasher-1.5.0-py3-none-any.whl |
Release files / kyasher-1.5.0-py3-none-any.whl
| Download URL | kyasher-1.5.0-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3c90d9f4dbe16c94fc67f5d60b2b339a22f8e960b7f40637f98cdd33ecc82104
|
|
BLAKE2b-256 checksum How to use checksums |
bcf00eec14c37e93128c9e42c7f2c2f616eed9316e618ab8c55b7b393c75959c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.9
|
Security for kyasher 1.5.0
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.