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.
- {emtl-0.2.1.dev3 → emtl-0.2.3}/.bumpversion.cfg +1 -1
- {emtl-0.2.1.dev3 → emtl-0.2.3}/.cookiecutterrc +1 -1
- emtl-0.2.3/.github/workflows/release.yml +29 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/CHANGELOG.rst +12 -0
- {emtl-0.2.1.dev3/src/emtl.egg-info → emtl-0.2.3}/PKG-INFO +14 -3
- {emtl-0.2.1.dev3 → emtl-0.2.3}/README.rst +5 -3
- {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/conf.py +1 -1
- emtl-0.2.3/docs/usage.rst +15 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/setup.py +1 -1
- {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl/__init__.py +3 -3
- {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl/_version.py +9 -4
- {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl/const.py +1 -1
- {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl/core.py +4 -4
- {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl/tests/test_core.py +3 -3
- {emtl-0.2.1.dev3 → emtl-0.2.3/src/emtl.egg-info}/PKG-INFO +14 -3
- {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl.egg-info/SOURCES.txt +1 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl.egg-info/entry_points.txt +0 -1
- emtl-0.2.1.dev3/docs/usage.rst +0 -12
- {emtl-0.2.1.dev3 → emtl-0.2.3}/.coveragerc +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/.editorconfig +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/.github/workflows/document.yml +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/.github/workflows/github-actions.yml +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/.gitignore +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/.pre-commit-config.yaml +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/.readthedocs.yml +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/AUTHORS.rst +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/CONTRIBUTING.rst +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/LICENSE +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/ci/bootstrap.py +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/ci/requirements.txt +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/ci/templates/.github/workflows/github-actions.yml +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/authors.rst +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/changelog.rst +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/contributing.rst +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/index.rst +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/installation.rst +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/readme.rst +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/reference/emtl.rst +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/reference/index.rst +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/requirements.txt +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/docs/spelling_wordlist.txt +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/pyproject.toml +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/pytest.ini +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/setup.cfg +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl/__main__.py +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl/cli.py +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl/tests/__init__.py +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl/tests/test_cli.py +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl/utils.py +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl.egg-info/dependency_links.txt +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl.egg-info/not-zip-safe +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl.egg-info/requires.txt +3 -3
- {emtl-0.2.1.dev3 → emtl-0.2.3}/src/emtl.egg-info/top_level.txt +0 -0
- {emtl-0.2.1.dev3 → emtl-0.2.3}/tox.ini +0 -0
|
@@ -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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: emtl
|
|
3
|
-
Version: 0.2.
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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:
|
|
@@ -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")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
__version__ = "0.2.
|
|
1
|
+
__version__ = "0.2.3"
|
|
2
2
|
|
|
3
3
|
from .core import cancel_order
|
|
4
|
-
from .core import
|
|
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
|
-
"
|
|
21
|
+
"create_order",
|
|
22
22
|
"cancel_order",
|
|
23
23
|
]
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
# file generated by
|
|
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
|
|
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.
|
|
16
|
-
__version_tuple__ = version_tuple = (0, 2,
|
|
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
|
-
"
|
|
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
|
|
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("
|
|
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: 订单字符串, 由成交日期+成交编号组成. 在
|
|
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
|
|
76
|
-
resp =
|
|
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.
|
|
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
|
-
|
|
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
|
emtl-0.2.1.dev3/docs/usage.rst
DELETED
|
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
|
|
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
|