akshare-proxy-patch 0.2.5__tar.gz → 0.2.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of akshare-proxy-patch might be problematic. Click here for more details.
- {akshare_proxy_patch-0.2.5 → akshare_proxy_patch-0.2.6}/PKG-INFO +9 -8
- {akshare_proxy_patch-0.2.5 → akshare_proxy_patch-0.2.6}/README.md +8 -7
- {akshare_proxy_patch-0.2.5 → akshare_proxy_patch-0.2.6}/akshare_proxy_patch/__init__.py +3 -3
- {akshare_proxy_patch-0.2.5 → akshare_proxy_patch-0.2.6}/akshare_proxy_patch.egg-info/PKG-INFO +9 -8
- {akshare_proxy_patch-0.2.5 → akshare_proxy_patch-0.2.6}/pyproject.toml +1 -1
- {akshare_proxy_patch-0.2.5 → akshare_proxy_patch-0.2.6}/setup.py +1 -1
- {akshare_proxy_patch-0.2.5 → akshare_proxy_patch-0.2.6}/LICENSE +0 -0
- {akshare_proxy_patch-0.2.5 → akshare_proxy_patch-0.2.6}/akshare_proxy_patch.egg-info/SOURCES.txt +0 -0
- {akshare_proxy_patch-0.2.5 → akshare_proxy_patch-0.2.6}/akshare_proxy_patch.egg-info/dependency_links.txt +0 -0
- {akshare_proxy_patch-0.2.5 → akshare_proxy_patch-0.2.6}/akshare_proxy_patch.egg-info/requires.txt +0 -0
- {akshare_proxy_patch-0.2.5 → akshare_proxy_patch-0.2.6}/akshare_proxy_patch.egg-info/top_level.txt +0 -0
- {akshare_proxy_patch-0.2.5 → akshare_proxy_patch-0.2.6}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: akshare-proxy-patch
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: 针对 AkShare 和 efinance 的底层补丁,自动为东财等接口注入代理认证头,从而避免 `stock_zh_a_spot_em` 等方法报错。
|
|
5
5
|
Home-page: https://github.com/helloyie/akshare-proxy-patch
|
|
6
6
|
Author: cheapproxy.net
|
|
@@ -19,7 +19,7 @@ Dynamic: license-file
|
|
|
19
19
|
Dynamic: requires-python
|
|
20
20
|
|
|
21
21
|
# AkShare Proxy Patch
|
|
22
|
-
针对 AkShare 和 efinance
|
|
22
|
+
针对 AkShare 和 efinance 的底层补丁,自动为东财接口注入代理认证头,从而避免`akshare: stock_zh_a_spot_em`、`efinance: get_realtime_quotes` 等东财 eastmoney 接口报错问题。
|
|
23
23
|
|
|
24
24
|
## 安装
|
|
25
25
|
|
|
@@ -33,14 +33,14 @@ pip install upgrade akshare
|
|
|
33
33
|
pip install upgrade efinance
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
2. 安装最新版本的 `akshare-proxy-patch`
|
|
36
|
+
2. 安装最新版本的 `akshare-proxy-patch`
|
|
37
37
|
```
|
|
38
|
-
pip install akshare-proxy-patch==0.2.
|
|
38
|
+
pip install akshare-proxy-patch==0.2.6
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
最好默认用国外源,国内源不是最新的,版本必须 >=0.2.4
|
|
42
42
|
|
|
43
|
-
##
|
|
43
|
+
## 使用方法
|
|
44
44
|
|
|
45
45
|
1. `akshare` 和 `efinance` 使用方式一致,在文件顶部添加如下代码
|
|
46
46
|
```
|
|
@@ -48,8 +48,9 @@ pip install akshare-proxy-patch==0.2.5
|
|
|
48
48
|
import akshare_proxy_patch
|
|
49
49
|
|
|
50
50
|
# 参数1: AUTH_IP
|
|
51
|
-
# 参数2: AUTH_TOKEN
|
|
52
|
-
|
|
51
|
+
# 参数2: AUTH_TOKEN,默认为空
|
|
52
|
+
# 参数3: retry 重试次数,默认30
|
|
53
|
+
akshare_proxy_patch.install_patch("101.201.173.125", "", 30)
|
|
53
54
|
|
|
54
55
|
# 你的正常业务代码不变
|
|
55
56
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# AkShare Proxy Patch
|
|
2
|
-
针对 AkShare 和 efinance
|
|
2
|
+
针对 AkShare 和 efinance 的底层补丁,自动为东财接口注入代理认证头,从而避免`akshare: stock_zh_a_spot_em`、`efinance: get_realtime_quotes` 等东财 eastmoney 接口报错问题。
|
|
3
3
|
|
|
4
4
|
## 安装
|
|
5
5
|
|
|
@@ -13,14 +13,14 @@ pip install upgrade akshare
|
|
|
13
13
|
pip install upgrade efinance
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
2. 安装最新版本的 `akshare-proxy-patch`
|
|
16
|
+
2. 安装最新版本的 `akshare-proxy-patch`
|
|
17
17
|
```
|
|
18
|
-
pip install akshare-proxy-patch==0.2.
|
|
18
|
+
pip install akshare-proxy-patch==0.2.6
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
最好默认用国外源,国内源不是最新的,版本必须 >=0.2.4
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## 使用方法
|
|
24
24
|
|
|
25
25
|
1. `akshare` 和 `efinance` 使用方式一致,在文件顶部添加如下代码
|
|
26
26
|
```
|
|
@@ -28,8 +28,9 @@ pip install akshare-proxy-patch==0.2.5
|
|
|
28
28
|
import akshare_proxy_patch
|
|
29
29
|
|
|
30
30
|
# 参数1: AUTH_IP
|
|
31
|
-
# 参数2: AUTH_TOKEN
|
|
32
|
-
|
|
31
|
+
# 参数2: AUTH_TOKEN,默认为空
|
|
32
|
+
# 参数3: retry 重试次数,默认30
|
|
33
|
+
akshare_proxy_patch.install_patch("101.201.173.125", "", 30)
|
|
33
34
|
|
|
34
35
|
# 你的正常业务代码不变
|
|
35
36
|
|
|
@@ -3,7 +3,7 @@ import threading
|
|
|
3
3
|
import requests
|
|
4
4
|
from requests.adapters import HTTPAdapter
|
|
5
5
|
|
|
6
|
-
__version__ = "0.2.
|
|
6
|
+
__version__ = "0.2.6"
|
|
7
7
|
# 备份 Session 的原始 request 方法,这是所有 requests.get/post 的最终入口
|
|
8
8
|
_original_request = requests.Session.request
|
|
9
9
|
_auth_session = requests.Session()
|
|
@@ -49,7 +49,7 @@ def get_auth_config_with_cache(auth_url, auth_token):
|
|
|
49
49
|
return _cache.data
|
|
50
50
|
|
|
51
51
|
|
|
52
|
-
def install_patch(auth_ip, auth_token):
|
|
52
|
+
def install_patch(auth_ip, auth_token, retry=30):
|
|
53
53
|
def patched_request(self, method, url, **kwargs):
|
|
54
54
|
# 排除非目标域名
|
|
55
55
|
is_target = any(
|
|
@@ -67,7 +67,7 @@ def install_patch(auth_ip, auth_token):
|
|
|
67
67
|
auth_url = f"http://{auth_ip}:47001/api/akshare-auth"
|
|
68
68
|
|
|
69
69
|
# 重试逻辑
|
|
70
|
-
for _ in range(
|
|
70
|
+
for _ in range(retry):
|
|
71
71
|
auth_res = get_auth_config_with_cache(auth_url, auth_token)
|
|
72
72
|
if not auth_res:
|
|
73
73
|
time.sleep(0.5)
|
{akshare_proxy_patch-0.2.5 → akshare_proxy_patch-0.2.6}/akshare_proxy_patch.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: akshare-proxy-patch
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: 针对 AkShare 和 efinance 的底层补丁,自动为东财等接口注入代理认证头,从而避免 `stock_zh_a_spot_em` 等方法报错。
|
|
5
5
|
Home-page: https://github.com/helloyie/akshare-proxy-patch
|
|
6
6
|
Author: cheapproxy.net
|
|
@@ -19,7 +19,7 @@ Dynamic: license-file
|
|
|
19
19
|
Dynamic: requires-python
|
|
20
20
|
|
|
21
21
|
# AkShare Proxy Patch
|
|
22
|
-
针对 AkShare 和 efinance
|
|
22
|
+
针对 AkShare 和 efinance 的底层补丁,自动为东财接口注入代理认证头,从而避免`akshare: stock_zh_a_spot_em`、`efinance: get_realtime_quotes` 等东财 eastmoney 接口报错问题。
|
|
23
23
|
|
|
24
24
|
## 安装
|
|
25
25
|
|
|
@@ -33,14 +33,14 @@ pip install upgrade akshare
|
|
|
33
33
|
pip install upgrade efinance
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
2. 安装最新版本的 `akshare-proxy-patch`
|
|
36
|
+
2. 安装最新版本的 `akshare-proxy-patch`
|
|
37
37
|
```
|
|
38
|
-
pip install akshare-proxy-patch==0.2.
|
|
38
|
+
pip install akshare-proxy-patch==0.2.6
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
最好默认用国外源,国内源不是最新的,版本必须 >=0.2.4
|
|
42
42
|
|
|
43
|
-
##
|
|
43
|
+
## 使用方法
|
|
44
44
|
|
|
45
45
|
1. `akshare` 和 `efinance` 使用方式一致,在文件顶部添加如下代码
|
|
46
46
|
```
|
|
@@ -48,8 +48,9 @@ pip install akshare-proxy-patch==0.2.5
|
|
|
48
48
|
import akshare_proxy_patch
|
|
49
49
|
|
|
50
50
|
# 参数1: AUTH_IP
|
|
51
|
-
# 参数2: AUTH_TOKEN
|
|
52
|
-
|
|
51
|
+
# 参数2: AUTH_TOKEN,默认为空
|
|
52
|
+
# 参数3: retry 重试次数,默认30
|
|
53
|
+
akshare_proxy_patch.install_patch("101.201.173.125", "", 30)
|
|
53
54
|
|
|
54
55
|
# 你的正常业务代码不变
|
|
55
56
|
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name="akshare-proxy-patch", # 包名,用户 pip install 时的名称
|
|
8
|
-
version="0.2.
|
|
8
|
+
version="0.2.6",
|
|
9
9
|
author="cheapproxy.net",
|
|
10
10
|
author_email="emezxyj1@gmail.com",
|
|
11
11
|
description="AkShare 和 efinance 报错全局Hook",
|
|
File without changes
|
{akshare_proxy_patch-0.2.5 → akshare_proxy_patch-0.2.6}/akshare_proxy_patch.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{akshare_proxy_patch-0.2.5 → akshare_proxy_patch-0.2.6}/akshare_proxy_patch.egg-info/requires.txt
RENAMED
|
File without changes
|
{akshare_proxy_patch-0.2.5 → akshare_proxy_patch-0.2.6}/akshare_proxy_patch.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|