emtl 0.2.1.dev3__tar.gz → 0.2.3__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 (54) hide show
  1. {emtl-0.2.1.dev3 → emtl-0.2.3}/.bumpversion.cfg +1 -1
  2. {emtl-0.2.1.dev3 → emtl-0.2.3}/.cookiecutterrc +1 -1
  3. emtl-0.2.3/.github/workflows/release.yml +29 -0
  4. {emtl-0.2.1.dev3 → emtl-0.2.3}/CHANGELOG.rst +12 -0
  5. {emtl-0.2.1.dev3/src/emtl.egg-info → emtl-0.2.3}/PKG-INFO +14 -3
  6. {emtl-0.2.1.dev3 → emtl-0.2.3}/README.rst +5 -3
  7. {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/conf.py +1 -1
  8. emtl-0.2.3/docs/usage.rst +15 -0
  9. {emtl-0.2.1.dev3 → emtl-0.2.3}/setup.py +1 -1
  10. {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl/__init__.py +3 -3
  11. {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl/_version.py +9 -4
  12. {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl/const.py +1 -1
  13. {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl/core.py +4 -4
  14. {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl/tests/test_core.py +3 -3
  15. {emtl-0.2.1.dev3 → emtl-0.2.3/src/emtl.egg-info}/PKG-INFO +14 -3
  16. {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl.egg-info/SOURCES.txt +1 -0
  17. {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl.egg-info/entry_points.txt +0 -1
  18. emtl-0.2.1.dev3/docs/usage.rst +0 -12
  19. {emtl-0.2.1.dev3 → emtl-0.2.3}/.coveragerc +0 -0
  20. {emtl-0.2.1.dev3 → emtl-0.2.3}/.editorconfig +0 -0
  21. {emtl-0.2.1.dev3 → emtl-0.2.3}/.github/workflows/document.yml +0 -0
  22. {emtl-0.2.1.dev3 → emtl-0.2.3}/.github/workflows/github-actions.yml +0 -0
  23. {emtl-0.2.1.dev3 → emtl-0.2.3}/.gitignore +0 -0
  24. {emtl-0.2.1.dev3 → emtl-0.2.3}/.pre-commit-config.yaml +0 -0
  25. {emtl-0.2.1.dev3 → emtl-0.2.3}/.readthedocs.yml +0 -0
  26. {emtl-0.2.1.dev3 → emtl-0.2.3}/AUTHORS.rst +0 -0
  27. {emtl-0.2.1.dev3 → emtl-0.2.3}/CONTRIBUTING.rst +0 -0
  28. {emtl-0.2.1.dev3 → emtl-0.2.3}/LICENSE +0 -0
  29. {emtl-0.2.1.dev3 → emtl-0.2.3}/ci/bootstrap.py +0 -0
  30. {emtl-0.2.1.dev3 → emtl-0.2.3}/ci/requirements.txt +0 -0
  31. {emtl-0.2.1.dev3 → emtl-0.2.3}/ci/templates/.github/workflows/github-actions.yml +0 -0
  32. {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/authors.rst +0 -0
  33. {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/changelog.rst +0 -0
  34. {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/contributing.rst +0 -0
  35. {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/index.rst +0 -0
  36. {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/installation.rst +0 -0
  37. {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/readme.rst +0 -0
  38. {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/reference/emtl.rst +0 -0
  39. {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/reference/index.rst +0 -0
  40. {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/requirements.txt +0 -0
  41. {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/spelling_wordlist.txt +0 -0
  42. {emtl-0.2.1.dev3 → emtl-0.2.3}/pyproject.toml +0 -0
  43. {emtl-0.2.1.dev3 → emtl-0.2.3}/pytest.ini +0 -0
  44. {emtl-0.2.1.dev3 → emtl-0.2.3}/setup.cfg +0 -0
  45. {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl/__main__.py +0 -0
  46. {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl/cli.py +0 -0
  47. {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl/tests/__init__.py +0 -0
  48. {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl/tests/test_cli.py +0 -0
  49. {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl/utils.py +0 -0
  50. {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl.egg-info/dependency_links.txt +0 -0
  51. {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl.egg-info/not-zip-safe +0 -0
  52. {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl.egg-info/requires.txt +3 -3
  53. {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl.egg-info/top_level.txt +0 -0
  54. {emtl-0.2.1.dev3 → emtl-0.2.3}/tox.ini +0 -0
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 0.2.0
2
+ current_version = 0.2.3
3
3
  commit = True
4
4
  tag = True
5
5
 
@@ -54,7 +54,7 @@ default_context:
54
54
  sphinx_theme: "alabaster"
55
55
  test_matrix_separate_coverage: "yes"
56
56
  tests_inside_package: "yes"
57
- version: "0.2.0"
57
+ version: "0.2.3"
58
58
  version_manager: "bump2version"
59
59
  website: "riiy.gihub.io/emtl"
60
60
  year_from: "2024"
@@ -0,0 +1,29 @@
1
+ name: Publish Python 🐍 distributions 📦 to PyPI
2
+ on:
3
+ push:
4
+ tags:
5
+ - '*'
6
+ jobs:
7
+ pypi-publish:
8
+ name: Upload release to PyPI
9
+ runs-on: ubuntu-latest
10
+ environment:
11
+ name: pypi
12
+ url: https://pypi.org/p/emtl
13
+ permissions:
14
+ id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
15
+ steps:
16
+ - uses: actions/checkout@master
17
+ - name: Set up Python 3.10
18
+ uses: actions/setup-python@v3
19
+ with:
20
+ python-version: '3.10'
21
+ - name: Install pypa/setuptools
22
+ run: >-
23
+ python -m
24
+ pip install wheel
25
+ - name: Build a binary wheel
26
+ run: >-
27
+ python setup.py sdist bdist_wheel
28
+ - name: Publish package distributions to PyPI
29
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -44,3 +44,15 @@ Changelog
44
44
  ------------------
45
45
 
46
46
  * complete all method
47
+
48
+
49
+ 0.2.1 (2024-05-29)
50
+ ------------------
51
+
52
+ * add auto deploy to pypi
53
+
54
+
55
+ 0.2.2 (2024-07-11)
56
+ ------------------
57
+
58
+ * replace insert_order with create_order
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: emtl
3
- Version: 0.2.1.dev3
3
+ Version: 0.2.3
4
4
  Summary: 东方财富自动交易接口
5
5
  Home-page: https://github.com/riiy/emtl
6
6
  Author: Riiy
@@ -10,7 +10,6 @@ Project-URL: Documentation, https://emtl.readthedocs.io/
10
10
  Project-URL: Changelog, https://emtl.readthedocs.io/en/latest/changelog.html
11
11
  Project-URL: Issue Tracker, https://github.com/riiy/emtl/issues
12
12
  Keywords: autotrade,trade,东方财富,股票,交易,交易机器人
13
- Platform: UNKNOWN
14
13
  Classifier: Development Status :: 5 - Production/Stable
15
14
  Classifier: Intended Audience :: Developers
16
15
  Classifier: License :: OSI Approved :: MIT License
@@ -59,8 +58,10 @@ https://emtl.readthedocs.io/
59
58
  Development
60
59
  ===========
61
60
 
62
- To run all the tests run::
61
+ 建议使用python3.11
63
62
 
63
+ To run all the tests run::
64
+ pip install -r ci/requirements.txt
64
65
  tox
65
66
 
66
67
  Note, to combine the coverage data from all the tox environments run:
@@ -135,3 +136,13 @@ Changelog
135
136
  * complete all method
136
137
 
137
138
 
139
+ 0.2.1 (2024-05-29)
140
+ ------------------
141
+
142
+ * add auto deploy to pypi
143
+
144
+
145
+ 0.2.2 (2024-07-11)
146
+ ------------------
147
+
148
+ * replace insert_order with create_order
@@ -41,9 +41,9 @@ Overview
41
41
  :alt: Supported implementations
42
42
  :target: https://pypi.org/project/emtl
43
43
 
44
- .. |commits-since| image:: https://img.shields.io/github/commits-since/riiy/emtl/v0.2.0.svg
44
+ .. |commits-since| image:: https://img.shields.io/github/commits-since/riiy/emtl/v0.2.3.svg
45
45
  :alt: Commits since latest release
46
- :target: https://github.com/riiy/emtl/compare/v0.2.0...master
46
+ :target: https://github.com/riiy/emtl/compare/v0.2.3...master
47
47
 
48
48
 
49
49
 
@@ -75,8 +75,10 @@ https://emtl.readthedocs.io/
75
75
  Development
76
76
  ===========
77
77
 
78
- To run all the tests run::
78
+ 建议使用python3.11
79
79
 
80
+ To run all the tests run::
81
+ pip install -r ci/requirements.txt
80
82
  tox
81
83
 
82
84
  Note, to combine the coverage data from all the tox environments run:
@@ -25,7 +25,7 @@ except Exception:
25
25
  import traceback
26
26
 
27
27
  traceback.print_exc()
28
- version = release = "0.2.0"
28
+ version = release = "0.2.3"
29
29
 
30
30
  pygments_style = "trac"
31
31
  templates_path = ["."]
@@ -0,0 +1,15 @@
1
+ =====
2
+ Usage
3
+ =====
4
+
5
+ To use the project:
6
+ 下面是登录、查询资产、下单、撤单的使用方法,具体使用请查看Reference
7
+
8
+ .. code-block:: python
9
+
10
+ import emtl
11
+ emtl.login("2020123456789", "123456")
12
+ asset = emtl.query_asset_and_position()
13
+ print(asset)
14
+ resp = create_order("000002", "B", "SA", 5.01, 100)
15
+ resp = cancel_order("20240520_130662")
@@ -16,7 +16,7 @@ setup(
16
16
  use_scm_version={
17
17
  "local_scheme": "dirty-tag",
18
18
  "write_to": "src/emtl/_version.py",
19
- "fallback_version": "0.2.0",
19
+ "fallback_version": "0.2.3",
20
20
  },
21
21
  license="MIT",
22
22
  description="东方财富自动交易接口",
@@ -1,7 +1,7 @@
1
- __version__ = "0.2.0"
1
+ __version__ = "0.2.3"
2
2
 
3
3
  from .core import cancel_order
4
- from .core import insert_order
4
+ from .core import create_order
5
5
  from .core import login
6
6
  from .core import query_asset_and_position
7
7
  from .core import query_funds_flow
@@ -18,6 +18,6 @@ __all__ = [
18
18
  "query_trades",
19
19
  "query_history_trades",
20
20
  "query_funds_flow",
21
- "insert_order",
21
+ "create_order",
22
22
  "cancel_order",
23
23
  ]
@@ -1,8 +1,13 @@
1
- # file generated by setuptools_scm
1
+ # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
+
4
+ __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
5
+
3
6
  TYPE_CHECKING = False
4
7
  if TYPE_CHECKING:
5
- from typing import Tuple, Union
8
+ from typing import Tuple
9
+ from typing import Union
10
+
6
11
  VERSION_TUPLE = Tuple[Union[int, str], ...]
7
12
  else:
8
13
  VERSION_TUPLE = object
@@ -12,5 +17,5 @@ __version__: str
12
17
  __version_tuple__: VERSION_TUPLE
13
18
  version_tuple: VERSION_TUPLE
14
19
 
15
- __version__ = version = '0.2.1.dev3'
16
- __version_tuple__ = version_tuple = (0, 2, 1, 'dev3')
20
+ __version__ = version = '0.2.3'
21
+ __version_tuple__ = version_tuple = (0, 2, 3)
@@ -8,7 +8,7 @@ _urls: dict = {
8
8
  "query_his_trades": "https://jywg.18.cn/Search/GetHisDealData?validatekey=",
9
9
  "query_funds_flow": "https://jywg.18.cn/Search/GetFundsFlow?validatekey=",
10
10
  "query_positions": "https://jywg.18.cn/Search/GetStockList?validatekey=",
11
- "insert_order": "https://jywg.18.cn/Trade/SubmitTradeV2?validatekey=",
11
+ "create_order": "https://jywg.18.cn/Trade/SubmitTradeV2?validatekey=",
12
12
  "cancel_order": "https://jywg.18.cn/Trade/RevokeOrders?validatekey=",
13
13
  }
14
14
  _base_headers: dict = {
@@ -199,7 +199,7 @@ def query_funds_flow(size, start_time, end_time):
199
199
  return resp.json()
200
200
 
201
201
 
202
- def insert_order(stock_code, trade_type, market: str, price: float, amount: int):
202
+ def create_order(stock_code, trade_type, market: str, price: float, amount: int):
203
203
  """交易接口, 买入或卖出.
204
204
 
205
205
  :param str stock_code: 股票代码
@@ -216,16 +216,16 @@ def insert_order(stock_code, trade_type, market: str, price: float, amount: int)
216
216
  "price": price,
217
217
  "amount": amount,
218
218
  }
219
- resp = _query_something("insert_order", req_data=req_data)
220
- logger.info(resp)
219
+ resp = _query_something("create_order", req_data=req_data)
221
220
  if resp:
221
+ logger.info(resp.json())
222
222
  return resp.json()
223
223
 
224
224
 
225
225
  def cancel_order(order_str: str):
226
226
  """取消交易接口.
227
227
 
228
- :param str order_str: 订单字符串, 由成交日期+成交编号组成. 在insert_order和query_order接口, Wtrq的值是成交日期, Wtbh的值是成交编号, 格式为: 20240520_130662
228
+ :param str order_str: 订单字符串, 由成交日期+成交编号组成. 在create_order和query_order接口, Wtrq的值是成交日期, Wtbh的值是成交编号, 格式为: 20240520_130662
229
229
  """
230
230
  data = {"revokes": order_str.strip()}
231
231
  resp = _query_something("cancel_order", req_data=data)
@@ -3,8 +3,8 @@ import math
3
3
  import os
4
4
 
5
5
  from emtl.core import cancel_order
6
+ from emtl.core import create_order
6
7
  from emtl.core import get_last_price
7
- from emtl.core import insert_order
8
8
  from emtl.core import query_funds_flow
9
9
  from emtl.core import query_history_orders
10
10
  from emtl.core import query_history_trades
@@ -72,8 +72,8 @@ def test_query_funds_flow():
72
72
  assert resp["Status"] == 0
73
73
 
74
74
 
75
- def test_insert_order():
76
- resp = insert_order("000002", "B", "SA", 5.01, 100)
75
+ def test_create_order():
76
+ resp = create_order("000002", "B", "SA", 5.01, 100)
77
77
  assert resp
78
78
  assert resp["Status"] in (0, -1)
79
79
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: emtl
3
- Version: 0.2.1.dev3
3
+ Version: 0.2.3
4
4
  Summary: 东方财富自动交易接口
5
5
  Home-page: https://github.com/riiy/emtl
6
6
  Author: Riiy
@@ -10,7 +10,6 @@ Project-URL: Documentation, https://emtl.readthedocs.io/
10
10
  Project-URL: Changelog, https://emtl.readthedocs.io/en/latest/changelog.html
11
11
  Project-URL: Issue Tracker, https://github.com/riiy/emtl/issues
12
12
  Keywords: autotrade,trade,东方财富,股票,交易,交易机器人
13
- Platform: UNKNOWN
14
13
  Classifier: Development Status :: 5 - Production/Stable
15
14
  Classifier: Intended Audience :: Developers
16
15
  Classifier: License :: OSI Approved :: MIT License
@@ -59,8 +58,10 @@ https://emtl.readthedocs.io/
59
58
  Development
60
59
  ===========
61
60
 
62
- To run all the tests run::
61
+ 建议使用python3.11
63
62
 
63
+ To run all the tests run::
64
+ pip install -r ci/requirements.txt
64
65
  tox
65
66
 
66
67
  Note, to combine the coverage data from all the tox environments run:
@@ -135,3 +136,13 @@ Changelog
135
136
  * complete all method
136
137
 
137
138
 
139
+ 0.2.1 (2024-05-29)
140
+ ------------------
141
+
142
+ * add auto deploy to pypi
143
+
144
+
145
+ 0.2.2 (2024-07-11)
146
+ ------------------
147
+
148
+ * replace insert_order with create_order
@@ -16,6 +16,7 @@ setup.py
16
16
  tox.ini
17
17
  .github/workflows/document.yml
18
18
  .github/workflows/github-actions.yml
19
+ .github/workflows/release.yml
19
20
  ci/bootstrap.py
20
21
  ci/requirements.txt
21
22
  ci/templates/.github/workflows/github-actions.yml
@@ -1,3 +1,2 @@
1
1
  [console_scripts]
2
2
  emt = emtl.cli:run
3
-
@@ -1,12 +0,0 @@
1
- =====
2
- Usage
3
- =====
4
-
5
- To use the project:
6
-
7
- .. code-block:: python
8
-
9
- import emtl
10
- emtl.login("2020123456789", "123456")
11
- asset = emtl.query_asset_and_position()
12
- print(asset)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,4 +1,4 @@
1
- cryptography==42.0.5
2
- ddddocr==1.4.11
3
- requests==2.31.0
4
1
  rsa==4.9
2
+ requests==2.31.0
3
+ ddddocr==1.4.11
4
+ cryptography==42.0.5
File without changes