Skip to main content

Afdian SDK for Python

Project description

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];

新建 Python 脚本,可直接复制以下模板,替换 auth_token 即可。

from afdiankit import Afdian, TokenAuthStrategy

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

使用开放平台 API

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

afdiankit-0.1.0.tar.gz (23.3 kB view hashes)

Uploaded Source

Built Distribution

afdiankit-0.1.0-py3-none-any.whl (39.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page