Catalog PyPI
PACKAGE EXPLORERView in registry

afdiankit

PyPI

Afdian SDK for Python

afdian
Versions collected1
Direct dependencies4From release 0.2.0
Last observed20 Oct, 21:02 UTC

README

Version 0.2.0 documentation

license pypi python black pyright ruff pre-commit

✨ 一个现代化的爱发电 Python SDK ✨

✨ 同时支持 同步 与 异步 调用 ✨

安装方式

pip install afdiankit
# or, use poetry
poetry add afdiankit
# or, use pdm
pdm add afdiankit

使用方法

使用爱发电网页端 API

获取网页端 auth_token

在爱发电网页端打开 F12 开发者工具,切换到 Console(控制台)标签页,输入以下 JavaScript 代码获取网页端 auth token

document.cookie.match(new RegExp("(^| )auth_token=([^;]+)"))[2];

调用 afdiankit 示例:

from afdiankit import Afdian, TokenAuthStrategy

afdian = Afdian("<auth_token>")
# 或者显式调用 TokenAuthStrategy
github = Afdian(TokenAuthStrategy("<auth_token>"))

使用开放平台 API

在开发者后台生成 webhook 的 token,复制 user_id。

调用 afdiankit 示例:

from afdiankit import Afdian, TokenAuthStrategy

afdian = Afdian()
user_id = "<user_id>"
token = "<token>"

afdian.open.post_ping(
    token=token,
    user_id=user_id,
    params={"a": "1"},
    ts=int(time.time())
).json()

许可证

项目源代码使用 MIT 许可证授权,见 LICENSE。

鸣谢

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.2.018 Sept 20234

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
starhearthunt/afdiankit

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:02 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:c16fad8906fd00f69c95c4008d3db8a39b479939cbeb4f7146ce37a57ed94942