Metadata-Version: 2.4
Name: wx-svr-api
Version: 0.1.0
Summary: 微信公众号服务端 API 封装：获取 access_token，可选 Redis 缓存。
Author: Pan Zhongxian
License-Expression: MIT
Project-URL: Homepage, https://github.com/easy-wx/wx-svr-ap
Project-URL: Repository, https://github.com/easy-wx/wx-svr-ap
Project-URL: Documentation, https://developers.weixin.qq.com/doc/subscription/api/base/api_getaccesstoken.html
Keywords: wechat,weixin,official-account,access-token,redis
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: requests<3,>=2.28.0
Requires-Dist: python-dotenv<2,>=1.0.0
Requires-Dist: redis<6,>=5.0.0
Provides-Extra: dev
Requires-Dist: build>=1.2.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"

# wx-svr-api

微信公众号服务端 API 封装：获取 `access_token`，支持从 `.env` 读取配置，以及可选的 Redis 缓存（TTL 7000 秒）。

- 源码：<https://github.com/easy-wx/wx-svr-ap>

## 安装

```bash
pip install wx-svr-api
```

## 用法

```python
from wx_svr_api import WxSvrApi

api = WxSvrApi.from_env()
token = api.get_access_token()
```

环境变量：`APPID`、`APPSECRET`；启用 Redis 缓存时配置 `REDIS_HOST`、`REDIS_PORT`、`REDIS_PASSWORD`、`REDIS_DB`。详见仓库内 `.env.example`。

## 文档

- [获取接口调用凭据（微信官方）](https://developers.weixin.qq.com/doc/subscription/api/base/api_getaccesstoken.html)
