Current collected state Current
Observed since 20 Oct, 21:02 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
afdiankit
Afdian SDK for Python
✨ 一个现代化的爱发电 Python SDK ✨
✨ 同时支持 同步 与 异步 调用 ✨
pip install afdiankit
# or, use poetry
poetry add afdiankit
# or, use pdm
pdm add afdiankit
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>"))
在开发者后台生成 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。
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
anyioEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.8,<4.0",
"evaluation": "NOT_EVALUATED"
} | anyio (>=3.6.1,<4.0.0) | runtime |
httpxEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.8,<4.0",
"evaluation": "NOT_EVALUATED"
} | httpx (>=0.23.0,<1.0.0) | runtime |
pydanticEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.8,<4.0",
"evaluation": "NOT_EVALUATED"
} | pydantic (>=2.0.0,<3.0.0) | runtime |
typing-extensionsEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.8,<4.0",
"evaluation": "NOT_EVALUATED"
} | typing-extensions (>=4.3.0,<5.0.0) | runtime |
bdist_wheel · 39.78 KB · Python py3
sdist · 23.78 KB · Python source
Observed since 20 Oct, 21:02 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:5daf0d3a98f5a79e0d9ddea6474facad1c0eed271ff17425ccb276b36dad3565