Akshare 引入 Proxy 代理解决 IP 被限问题
安装部署
# 安装python安装工具
pip install setuptools
pip install
python setup.py check
python setup.py sdist bdist_wheel
twine upload dist/*
twine upload --repository testpypi dist/*
twine upload --repository pypi dist/*
pip install akshare-proxy==1.17.87.dev0
pip install --upgrade --index-url https://test.pypi.org/simple/ akshare-proxy==1.17.87.dev2
## 本地调试安装
pip install .
验证安装
import akshare as ak
print(ak.__version__)
代理配置
from akshare.utils.context import AkshareConfig
import akshare as ak
""" 创建代理字典 """
proxies = {
"http": "http://xxx.con:xxx",
"https": "https://xxx.con:xxx"
}
""" 创建代理字典 """
AkshareConfig.set_proxies(proxies)
stock_sse_summary_df = ak.stock_sse_summary()
print(stock_sse_summary_df)
IP 代理搭建
免费代理
https://github.com/AlexLiue/proxy_pool
收费代理
代码更新管理脚本备注
# 克隆项目
git clone https://github.com/AlexLiue/akshare.git
# 查看分支
git remote -v
# 添加上游仓库地址
git remote add upstream https://github.com/akfamily/akshare.git
# 合并上游更新到本地项目 (先本地创建合并分支,然后合并)
git checkout develop
git fetch upstream
git merge upstream/main
# 提交
git add .
git commit -m '20250401'
# 合并更新到主分支
git checkout main
git pull origin main
git merge develop
# 提交主分支
git add .
git commit -m '20250401'
git tag v0.0.1
git push origin master
Metadata
Release files for akshare-proxy 1.17.88
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| akshare_proxy-1.17.88.tar.gz | 852.4 kB | Without provenance | Details for akshare_proxy-1.17.88.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| akshare_proxy-1.17.88-py3-none-any.whl | Python 3 | none | any | Details for akshare_proxy-1.17.88-py3-none-any.whl |
Total release size: 1.9 MB
Security for akshare-proxy 1.17.88
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.