tickflow 0.1.0.dev0__tar.gz → 0.1.0.dev1__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.
Files changed (28) hide show
  1. tickflow-0.1.0.dev1/PKG-INFO +109 -0
  2. tickflow-0.1.0.dev1/README.md +77 -0
  3. {tickflow-0.1.0.dev0 → tickflow-0.1.0.dev1}/pyproject.toml +22 -25
  4. tickflow-0.1.0.dev1/tickflow/__init__.py +75 -0
  5. {tickflow-0.1.0.dev0 → tickflow-0.1.0.dev1}/tickflow/_base_client.py +213 -70
  6. {tickflow-0.1.0.dev0 → tickflow-0.1.0.dev1}/tickflow/client.py +20 -13
  7. {tickflow-0.1.0.dev0 → tickflow-0.1.0.dev1}/tickflow/generated_model.py +86 -84
  8. {tickflow-0.1.0.dev0 → tickflow-0.1.0.dev1}/tickflow/resources/__init__.py +3 -3
  9. {tickflow-0.1.0.dev0 → tickflow-0.1.0.dev1}/tickflow/resources/exchanges.py +49 -23
  10. tickflow-0.1.0.dev1/tickflow/resources/instruments.py +180 -0
  11. {tickflow-0.1.0.dev0 → tickflow-0.1.0.dev1}/tickflow/resources/klines.py +263 -29
  12. tickflow-0.1.0.dev1/tickflow.egg-info/PKG-INFO +109 -0
  13. {tickflow-0.1.0.dev0 → tickflow-0.1.0.dev1}/tickflow.egg-info/SOURCES.txt +1 -1
  14. tickflow-0.1.0.dev1/tickflow.egg-info/requires.txt +12 -0
  15. tickflow-0.1.0.dev0/PKG-INFO +0 -36
  16. tickflow-0.1.0.dev0/README.md +0 -0
  17. tickflow-0.1.0.dev0/tickflow/__init__.py +0 -136
  18. tickflow-0.1.0.dev0/tickflow/resources/symbols.py +0 -176
  19. tickflow-0.1.0.dev0/tickflow.egg-info/PKG-INFO +0 -36
  20. tickflow-0.1.0.dev0/tickflow.egg-info/requires.txt +0 -14
  21. {tickflow-0.1.0.dev0 → tickflow-0.1.0.dev1}/setup.cfg +0 -0
  22. {tickflow-0.1.0.dev0 → tickflow-0.1.0.dev1}/tickflow/_exceptions.py +0 -0
  23. {tickflow-0.1.0.dev0 → tickflow-0.1.0.dev1}/tickflow/_types.py +0 -0
  24. {tickflow-0.1.0.dev0 → tickflow-0.1.0.dev1}/tickflow/resources/_base.py +0 -0
  25. {tickflow-0.1.0.dev0 → tickflow-0.1.0.dev1}/tickflow/resources/quotes.py +0 -0
  26. {tickflow-0.1.0.dev0 → tickflow-0.1.0.dev1}/tickflow/resources/universes.py +0 -0
  27. {tickflow-0.1.0.dev0 → tickflow-0.1.0.dev1}/tickflow.egg-info/dependency_links.txt +0 -0
  28. {tickflow-0.1.0.dev0 → tickflow-0.1.0.dev1}/tickflow.egg-info/top_level.txt +0 -0
@@ -0,0 +1,109 @@
1
+ Metadata-Version: 2.4
2
+ Name: tickflow
3
+ Version: 0.1.0.dev1
4
+ Summary: TickFlow Python Client
5
+ Author: TickFlow Team
6
+ License: MIT
7
+ Project-URL: Documentation, https://docs.tickflow.org
8
+ Project-URL: Repository, https://github.com/tickflow/tickflow-python
9
+ Keywords: finance,stock,market-data,trading,api-client
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Intended Audience :: Financial and Insurance Industry
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Office/Business :: Financial :: Investment
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: httpx>=0.25.0
24
+ Requires-Dist: typing-extensions>=4.0.0
25
+ Provides-Extra: pandas
26
+ Requires-Dist: pandas>=1.5.0; extra == "pandas"
27
+ Provides-Extra: progress
28
+ Requires-Dist: tqdm>=4.60.0; extra == "progress"
29
+ Provides-Extra: all
30
+ Requires-Dist: pandas>=1.5.0; extra == "all"
31
+ Requires-Dist: tqdm>=4.60.0; extra == "all"
32
+
33
+ # TickFlow Python SDK
34
+
35
+ 高性能行情数据 Python 客户端,支持 A股、美股、港股。
36
+
37
+ ## 安装
38
+
39
+ ```bash
40
+ pip install tickflow
41
+ ```
42
+
43
+ 如需 DataFrame 支持和进度条功能:
44
+
45
+ ```bash
46
+ pip install tickflow[all]
47
+ ```
48
+
49
+ ## 快速开始
50
+
51
+ ```python
52
+ from tickflow import TickFlow
53
+
54
+ # 初始化客户端
55
+ client = TickFlow(api_key="your-api-key")
56
+
57
+ # 获取 K 线数据
58
+ df = client.klines.get("600000.SH", period="1d", count=100, as_dataframe=True)
59
+ print(df.tail())
60
+
61
+ # 获取实时行情
62
+ quotes = client.quotes.get(symbols=["600000.SH", "AAPL.US"])
63
+ for q in quotes:
64
+ print(f"{q['symbol']}: {q['last_price']}")
65
+ ```
66
+
67
+ ## 异步使用
68
+
69
+ ```python
70
+ import asyncio
71
+ from tickflow import AsyncTickFlow
72
+
73
+ async def main():
74
+ async with AsyncTickFlow(api_key="your-api-key") as client:
75
+ df = await client.klines.get("600000.SH", as_dataframe=True)
76
+ print(df.tail())
77
+
78
+ asyncio.run(main())
79
+ ```
80
+
81
+ ## 批量获取
82
+
83
+ ```python
84
+ # 批量获取大量股票数据,自动分批并发请求
85
+ symbols = client.exchanges.get_symbols("SH")[:500]
86
+ df = client.klines.batch(
87
+ symbols,
88
+ period="1d",
89
+ as_dataframe=True,
90
+ show_progress=True # 显示进度条
91
+ )
92
+ ```
93
+
94
+ ## 特性
95
+
96
+ - ✅ 同步/异步双接口
97
+ - ✅ DataFrame 原生支持
98
+ - ✅ 自动重试(网络错误、服务器错误)
99
+ - ✅ 批量请求自动分片
100
+ - ✅ 进度条支持
101
+ - ✅ 完整类型注解
102
+
103
+ ## 文档
104
+
105
+ 完整文档请访问:https://docs.tickflow.org
106
+
107
+ ## License
108
+
109
+ MIT
@@ -0,0 +1,77 @@
1
+ # TickFlow Python SDK
2
+
3
+ 高性能行情数据 Python 客户端,支持 A股、美股、港股。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ pip install tickflow
9
+ ```
10
+
11
+ 如需 DataFrame 支持和进度条功能:
12
+
13
+ ```bash
14
+ pip install tickflow[all]
15
+ ```
16
+
17
+ ## 快速开始
18
+
19
+ ```python
20
+ from tickflow import TickFlow
21
+
22
+ # 初始化客户端
23
+ client = TickFlow(api_key="your-api-key")
24
+
25
+ # 获取 K 线数据
26
+ df = client.klines.get("600000.SH", period="1d", count=100, as_dataframe=True)
27
+ print(df.tail())
28
+
29
+ # 获取实时行情
30
+ quotes = client.quotes.get(symbols=["600000.SH", "AAPL.US"])
31
+ for q in quotes:
32
+ print(f"{q['symbol']}: {q['last_price']}")
33
+ ```
34
+
35
+ ## 异步使用
36
+
37
+ ```python
38
+ import asyncio
39
+ from tickflow import AsyncTickFlow
40
+
41
+ async def main():
42
+ async with AsyncTickFlow(api_key="your-api-key") as client:
43
+ df = await client.klines.get("600000.SH", as_dataframe=True)
44
+ print(df.tail())
45
+
46
+ asyncio.run(main())
47
+ ```
48
+
49
+ ## 批量获取
50
+
51
+ ```python
52
+ # 批量获取大量股票数据,自动分批并发请求
53
+ symbols = client.exchanges.get_symbols("SH")[:500]
54
+ df = client.klines.batch(
55
+ symbols,
56
+ period="1d",
57
+ as_dataframe=True,
58
+ show_progress=True # 显示进度条
59
+ )
60
+ ```
61
+
62
+ ## 特性
63
+
64
+ - ✅ 同步/异步双接口
65
+ - ✅ DataFrame 原生支持
66
+ - ✅ 自动重试(网络错误、服务器错误)
67
+ - ✅ 批量请求自动分片
68
+ - ✅ 进度条支持
69
+ - ✅ 完整类型注解
70
+
71
+ ## 文档
72
+
73
+ 完整文档请访问:https://docs.tickflow.org
74
+
75
+ ## License
76
+
77
+ MIT
@@ -1,47 +1,44 @@
1
1
  [project]
2
2
  name = "tickflow"
3
- version = "0.1.0-dev"
4
- description = "TickFlow Python Client - High-performance market data API for A-shares, US stocks, and Hong Kong stocks"
3
+ version = "0.1.0-dev1"
4
+ description = "TickFlow Python Client"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.9"
7
- license = { text = "MIT" }
7
+ license = {text = "MIT"}
8
8
  authors = [
9
- { name = "TickFlow Team" }
9
+ {name = "TickFlow Team"}
10
10
  ]
11
- keywords = ["finance", "market-data", "stocks", "trading", "api-client", "async"]
11
+ keywords = ["finance", "stock", "market-data", "trading", "api-client"]
12
12
  classifiers = [
13
13
  "Development Status :: 4 - Beta",
14
14
  "Intended Audience :: Developers",
15
15
  "Intended Audience :: Financial and Insurance Industry",
16
16
  "License :: OSI Approved :: MIT License",
17
- "Operating System :: OS Independent",
18
17
  "Programming Language :: Python :: 3",
19
18
  "Programming Language :: Python :: 3.9",
20
19
  "Programming Language :: Python :: 3.10",
21
20
  "Programming Language :: Python :: 3.11",
22
21
  "Programming Language :: Python :: 3.12",
23
22
  "Topic :: Office/Business :: Financial :: Investment",
24
- "Topic :: Software Development :: Libraries :: Python Modules",
25
23
  "Typing :: Typed",
26
24
  ]
27
-
28
25
  dependencies = [
29
- "httpx>=0.28.1",
30
- "pandas>=1.3.0",
26
+ "httpx>=0.25.0",
31
27
  "typing-extensions>=4.0.0",
32
28
  ]
33
29
 
34
30
  [project.optional-dependencies]
35
- pandas = ["pandas>=1.3.0"]
36
- all = ["pandas>=1.3.0"]
37
- dev = [
38
- "datamodel-code-generator[http]>=0.45.0",
39
- "pytest>=7.0.0",
40
- "pytest-asyncio>=0.21.0",
31
+ # DataFrame support
32
+ pandas = ["pandas>=1.5.0"]
33
+ # Progress bar for batch operations
34
+ progress = ["tqdm>=4.60.0"]
35
+ # All optional features
36
+ all = [
37
+ "pandas>=1.5.0",
38
+ "tqdm>=4.60.0",
41
39
  ]
42
40
 
43
41
  [project.urls]
44
- Homepage = "https://tickflow.org"
45
42
  Documentation = "https://docs.tickflow.org"
46
43
  Repository = "https://github.com/tickflow/tickflow-python"
47
44
 
@@ -50,13 +47,13 @@ requires = ["setuptools>=61.0", "wheel"]
50
47
  build-backend = "setuptools.build_meta"
51
48
 
52
49
  [tool.setuptools.packages.find]
53
- where = ["."]
54
50
  include = ["tickflow*"]
55
51
 
56
- [tool.setuptools.package-data]
57
- tickflow = ["py.typed"]
58
-
59
-
60
- [tool.pytest.ini_options]
61
- asyncio_mode = "auto"
62
- testpaths = ["tests"]
52
+ [dependency-groups]
53
+ dev = [
54
+ "datamodel-code-generator[http]>=0.45.0",
55
+ "pytest>=7.0.0",
56
+ "pytest-asyncio>=0.21.0",
57
+ "ruff>=0.1.0",
58
+ "mypy>=1.0.0",
59
+ ]
@@ -0,0 +1,75 @@
1
+ """TickFlow Python SDK - 高性能行情数据客户端。
2
+
3
+ 支持 A股、美股、港股的行情数据查询,提供同步和异步两种接口。
4
+
5
+ Examples
6
+ --------
7
+ 同步使用:
8
+
9
+ >>> from tickflow import TickFlow
10
+ >>> client = TickFlow(api_key="your-api-key")
11
+ >>> df = client.klines.get("600000.SH", as_dataframe=True)
12
+ >>> print(df.tail())
13
+
14
+ 异步使用:
15
+
16
+ >>> import asyncio
17
+ >>> from tickflow import AsyncTickFlow
18
+ >>>
19
+ >>> async def main():
20
+ ... async with AsyncTickFlow(api_key="your-api-key") as client:
21
+ ... df = await client.klines.get("600000.SH", as_dataframe=True)
22
+ ... print(df.tail())
23
+ >>>
24
+ >>> asyncio.run(main())
25
+ """
26
+
27
+ from ._exceptions import (
28
+ APIError,
29
+ AuthenticationError,
30
+ BadRequestError,
31
+ ConnectionError,
32
+ InternalServerError,
33
+ NotFoundError,
34
+ PermissionError,
35
+ RateLimitError,
36
+ TickFlowError,
37
+ TimeoutError,
38
+ )
39
+ from .client import AsyncTickFlow, TickFlow
40
+ from .generated_model import (
41
+ CompactKlineData,
42
+ Instrument,
43
+ InstrumentType,
44
+ Period,
45
+ Quote,
46
+ Region,
47
+ SessionStatus,
48
+ )
49
+
50
+ __version__ = "0.1.0"
51
+
52
+ __all__ = [
53
+ # Main clients
54
+ "TickFlow",
55
+ "AsyncTickFlow",
56
+ # Exceptions
57
+ "TickFlowError",
58
+ "APIError",
59
+ "AuthenticationError",
60
+ "PermissionError",
61
+ "NotFoundError",
62
+ "BadRequestError",
63
+ "RateLimitError",
64
+ "InternalServerError",
65
+ "ConnectionError",
66
+ "TimeoutError",
67
+ # Types
68
+ "CompactKlineData",
69
+ "Instrument",
70
+ "InstrumentType",
71
+ "Period",
72
+ "Quote",
73
+ "Region",
74
+ "SessionStatus",
75
+ ]