ktools 0.2.14__tar.gz → 1.0.2__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.
ktools-1.0.2/PKG-INFO ADDED
@@ -0,0 +1,52 @@
1
+ Metadata-Version: 2.1
2
+ Name: ktools
3
+ Version: 1.0.2
4
+ Summary: kirin's toolkit.
5
+ Home-page: https://github.com/fx-kirin/ktools
6
+ Author: fx-kirin
7
+ Author-email: ono.kirin@gmail.com
8
+ Classifier: Development Status :: 2 - Pre-Alpha
9
+ Classifier: Programming Language :: Python
10
+ Classifier: Programming Language :: Python :: 2
11
+ Classifier: Programming Language :: Python :: 2.7
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.4
14
+ Classifier: Programming Language :: Python :: 3.5
15
+ Classifier: Programming Language :: Python :: 3.6
16
+ Classifier: Programming Language :: Python :: 3.7
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+
21
+ ktools
22
+ ======
23
+
24
+ .. image:: https://img.shields.io/pypi/v/ktools.svg
25
+ :target: https://pypi.python.org/pypi/ktools
26
+ :alt: Latest PyPI version
27
+
28
+ .. image:: https://github.com/fx-kirin/ktools.png
29
+ :target: https://github.com/fx-kirin/ktools
30
+ :alt: Latest Travis CI build status
31
+
32
+ kirin's toolkit.
33
+
34
+ Usage
35
+ -----
36
+
37
+ Installation
38
+ ------------
39
+
40
+ Requirements
41
+ ^^^^^^^^^^^^
42
+
43
+ Compatibility
44
+ -------------
45
+
46
+ Licence
47
+ -------
48
+
49
+ Authors
50
+ -------
51
+
52
+ `ktools` was written by `fx-kirin <ono.kirin@gmail.com>`_.
@@ -8,7 +8,7 @@ def get_diff_from_initial_value(series):
8
8
 
9
9
 
10
10
  def convert_datetimeindex_to_timestamp(index):
11
- return (index.astype(np.int64).astype(np.float) // 10**9) + time.timezone
11
+ return (index.astype(np.int64).astype(float) // 10**9) + time.timezone
12
12
 
13
13
 
14
14
  def get_redundant_pairs(df):
@@ -0,0 +1,170 @@
1
+ #! /usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ # vim:fenc=utf-8
4
+ #
5
+ # Copyright © 2022 fx-kirin <fx.kirin@gmail.com>
6
+ #
7
+ # Distributed under terms of the MIT license.
8
+
9
+ """
10
+
11
+ """
12
+ import pandas as pd
13
+ from kanirequests import KaniRequests
14
+
15
+
16
+ def get_nehaba_limit(last_execution):
17
+ if last_execution < 200:
18
+ return 5
19
+ if last_execution < 500:
20
+ return 8
21
+ if last_execution < 700:
22
+ return 10
23
+ if last_execution < 1000:
24
+ return 15
25
+ if last_execution < 1500:
26
+ return 30
27
+ if last_execution < 2000:
28
+ return 40
29
+ if last_execution < 3000:
30
+ return 50
31
+ if last_execution < 5000:
32
+ return 70
33
+ if last_execution < 7000:
34
+ return 100
35
+ if last_execution < 10000:
36
+ return 150
37
+ if last_execution < 15000:
38
+ return 300
39
+ if last_execution < 20000:
40
+ return 400
41
+ if last_execution < 30000:
42
+ return 500
43
+ if last_execution < 50000:
44
+ return 700
45
+ if last_execution < 70000:
46
+ return 1000
47
+ if last_execution < 100000:
48
+ return 1500
49
+ if last_execution < 150000:
50
+ return 3000
51
+ if last_execution < 200000:
52
+ return 4000
53
+ if last_execution < 300000:
54
+ return 5000
55
+ if last_execution < 500000:
56
+ return 7000
57
+ if last_execution < 700000:
58
+ return 10000
59
+ if last_execution < 1000000:
60
+ return 15000
61
+ if last_execution < 1500000:
62
+ return 30000
63
+ if last_execution < 2000000:
64
+ return 40000
65
+ if last_execution < 3000000:
66
+ return 50000
67
+ if last_execution < 5000000:
68
+ return 70000
69
+ if last_execution < 7000000:
70
+ return 100000
71
+ if last_execution < 10000000:
72
+ return 150000
73
+ if last_execution < 15000000:
74
+ return 300000
75
+ if last_execution < 20000000:
76
+ return 400000
77
+ if last_execution < 30000000:
78
+ return 500000
79
+ if last_execution < 50000000:
80
+ return 700000
81
+ return 1000000
82
+
83
+
84
+ def get_price_limit(last_execution):
85
+ if last_execution < 100:
86
+ return 30
87
+ if last_execution < 200:
88
+ return 50
89
+ if last_execution < 500:
90
+ return 80
91
+ if last_execution < 700:
92
+ return 100
93
+ if last_execution < 1000:
94
+ return 150
95
+ if last_execution < 1500:
96
+ return 300
97
+ if last_execution < 2000:
98
+ return 400
99
+ if last_execution < 3000:
100
+ return 500
101
+ if last_execution < 5000:
102
+ return 700
103
+ if last_execution < 7000:
104
+ return 1000
105
+ if last_execution < 10000:
106
+ return 1500
107
+ if last_execution < 15000:
108
+ return 3000
109
+ if last_execution < 20000:
110
+ return 4000
111
+ if last_execution < 30000:
112
+ return 5000
113
+ if last_execution < 50000:
114
+ return 7000
115
+ if last_execution < 70000:
116
+ return 10000
117
+ if last_execution < 100000:
118
+ return 15000
119
+ if last_execution < 150000:
120
+ return 30000
121
+ if last_execution < 200000:
122
+ return 40000
123
+ if last_execution < 300000:
124
+ return 50000
125
+ if last_execution < 500000:
126
+ return 70000
127
+ if last_execution < 700000:
128
+ return 100000
129
+ if last_execution < 1000000:
130
+ return 150000
131
+ if last_execution < 1500000:
132
+ return 300000
133
+ if last_execution < 2000000:
134
+ return 400000
135
+ if last_execution < 3000000:
136
+ return 500000
137
+ if last_execution < 5000000:
138
+ return 700000
139
+ if last_execution < 7000000:
140
+ return 1000000
141
+ if last_execution < 10000000:
142
+ return 1500000
143
+ if last_execution < 15000000:
144
+ return 3000000
145
+ if last_execution < 20000000:
146
+ return 4000000
147
+ if last_execution < 30000000:
148
+ return 5000000
149
+ if last_execution < 50000000:
150
+ return 7000000
151
+ return 10000000
152
+
153
+
154
+ def get_ms_warrant_history(stock_code):
155
+ headers = {
156
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0",
157
+ 'Accept-Language': 'ja,en-US;q=0.7,en;q=0.3',
158
+ 'Connection': 'keep-alive',
159
+ 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
160
+ 'Accept-Encoding': 'gzip, deflate, br',
161
+ 'Cache-Control': 'max-age=0'
162
+ }
163
+
164
+ session = KaniRequests(headers=headers)
165
+ result = session.get("https://docs.google.com/spreadsheets/d/e/2PACX-1vQ-SPWgeUiBs8pcrj9vFxYI7-9srSjfy2JDSoJ2-gZ4-bqhCltL2qvzZ2AMkNV7xZ72GH9_jnWqfHM0/pubhtml/sheet?headers=false&gid=0")
166
+ table = result.html.find("table")[0]
167
+ df = pd.read_html(table.raw_html.decode("utf8"), skiprows=4)[0]
168
+ df = df.iloc[:, 1:4]
169
+ df.columns = ["published_date", "stock_code", "name"]
170
+ return df[df["stock_code"] == str(stock_code)]
@@ -0,0 +1,52 @@
1
+ Metadata-Version: 2.1
2
+ Name: ktools
3
+ Version: 1.0.2
4
+ Summary: kirin's toolkit.
5
+ Home-page: https://github.com/fx-kirin/ktools
6
+ Author: fx-kirin
7
+ Author-email: ono.kirin@gmail.com
8
+ Classifier: Development Status :: 2 - Pre-Alpha
9
+ Classifier: Programming Language :: Python
10
+ Classifier: Programming Language :: Python :: 2
11
+ Classifier: Programming Language :: Python :: 2.7
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.4
14
+ Classifier: Programming Language :: Python :: 3.5
15
+ Classifier: Programming Language :: Python :: 3.6
16
+ Classifier: Programming Language :: Python :: 3.7
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+
21
+ ktools
22
+ ======
23
+
24
+ .. image:: https://img.shields.io/pypi/v/ktools.svg
25
+ :target: https://pypi.python.org/pypi/ktools
26
+ :alt: Latest PyPI version
27
+
28
+ .. image:: https://github.com/fx-kirin/ktools.png
29
+ :target: https://github.com/fx-kirin/ktools
30
+ :alt: Latest Travis CI build status
31
+
32
+ kirin's toolkit.
33
+
34
+ Usage
35
+ -----
36
+
37
+ Installation
38
+ ------------
39
+
40
+ Requirements
41
+ ^^^^^^^^^^^^
42
+
43
+ Compatibility
44
+ -------------
45
+
46
+ Licence
47
+ -------
48
+
49
+ Authors
50
+ -------
51
+
52
+ `ktools` was written by `fx-kirin <ono.kirin@gmail.com>`_.
@@ -7,9 +7,11 @@ ktools/diskcache.py
7
7
  ktools/kanichart.py
8
8
  ktools/numpy.py
9
9
  ktools/pandas.py
10
+ ktools/stock.py
10
11
  ktools.egg-info/PKG-INFO
11
12
  ktools.egg-info/SOURCES.txt
12
13
  ktools.egg-info/dependency_links.txt
13
14
  ktools.egg-info/top_level.txt
14
15
  tests/__init__.py
15
- tests/test_sample.py
16
+ tests/test_sample.py
17
+ tests/test_stock.py
@@ -2,7 +2,7 @@ import setuptools
2
2
 
3
3
  setuptools.setup(
4
4
  name="ktools",
5
- version="0.2.14",
5
+ version="1.0.2",
6
6
  url="https://github.com/fx-kirin/ktools",
7
7
 
8
8
  author="fx-kirin",
@@ -0,0 +1,47 @@
1
+ #! /usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ # vim:fenc=utf-8
4
+ #
5
+ # Copyright © 2024 fx-kirin <fx.kirin@gmail.com>
6
+ #
7
+
8
+ import logging
9
+ import os
10
+
11
+ import kanilog
12
+ import pytest
13
+ import stdlogging
14
+ from add_parent_path import add_parent_path
15
+
16
+ with add_parent_path():
17
+ from ktools import stock
18
+ pass
19
+
20
+
21
+ def setup_module(module):
22
+ pass
23
+
24
+
25
+ def teardown_module(module):
26
+ pass
27
+
28
+
29
+ def setup_function(function):
30
+ pass
31
+
32
+
33
+ def teardown_function(function):
34
+ pass
35
+
36
+
37
+ def test_func():
38
+ result = stock.get_ms_warrant_history("4588")
39
+ assert len(result) >= 5
40
+
41
+
42
+ if __name__ == "__main__":
43
+ os.chdir(os.path.dirname(os.path.abspath(__file__)))
44
+ kanilog.setup_logger(logfile='/tmp/%s.log' % (os.path.basename(__file__)), level=logging.INFO)
45
+ stdlogging.enable()
46
+
47
+ pytest.main([__file__, '-k test_', '-s'])
ktools-0.2.14/PKG-INFO DELETED
@@ -1,54 +0,0 @@
1
- Metadata-Version: 1.1
2
- Name: ktools
3
- Version: 0.2.14
4
- Summary: kirin's toolkit.
5
- Home-page: https://github.com/fx-kirin/ktools
6
- Author: fx-kirin
7
- Author-email: ono.kirin@gmail.com
8
- License: UNKNOWN
9
- Description: ktools
10
- ======
11
-
12
- .. image:: https://img.shields.io/pypi/v/ktools.svg
13
- :target: https://pypi.python.org/pypi/ktools
14
- :alt: Latest PyPI version
15
-
16
- .. image:: https://github.com/fx-kirin/ktools.png
17
- :target: https://github.com/fx-kirin/ktools
18
- :alt: Latest Travis CI build status
19
-
20
- kirin's toolkit.
21
-
22
- Usage
23
- -----
24
-
25
- Installation
26
- ------------
27
-
28
- Requirements
29
- ^^^^^^^^^^^^
30
-
31
- Compatibility
32
- -------------
33
-
34
- Licence
35
- -------
36
-
37
- Authors
38
- -------
39
-
40
- `ktools` was written by `fx-kirin <ono.kirin@gmail.com>`_.
41
-
42
- Platform: UNKNOWN
43
- Classifier: Development Status :: 2 - Pre-Alpha
44
- Classifier: Programming Language :: Python
45
- Classifier: Programming Language :: Python :: 2
46
- Classifier: Programming Language :: Python :: 2.7
47
- Classifier: Programming Language :: Python :: 3
48
- Classifier: Programming Language :: Python :: 3.4
49
- Classifier: Programming Language :: Python :: 3.5
50
- Classifier: Programming Language :: Python :: 3.6
51
- Classifier: Programming Language :: Python :: 3.7
52
- Classifier: Programming Language :: Python :: 3.8
53
- Classifier: Programming Language :: Python :: 3.9
54
- Classifier: Programming Language :: Python :: 3.10
@@ -1,54 +0,0 @@
1
- Metadata-Version: 1.1
2
- Name: ktools
3
- Version: 0.2.14
4
- Summary: kirin's toolkit.
5
- Home-page: https://github.com/fx-kirin/ktools
6
- Author: fx-kirin
7
- Author-email: ono.kirin@gmail.com
8
- License: UNKNOWN
9
- Description: ktools
10
- ======
11
-
12
- .. image:: https://img.shields.io/pypi/v/ktools.svg
13
- :target: https://pypi.python.org/pypi/ktools
14
- :alt: Latest PyPI version
15
-
16
- .. image:: https://github.com/fx-kirin/ktools.png
17
- :target: https://github.com/fx-kirin/ktools
18
- :alt: Latest Travis CI build status
19
-
20
- kirin's toolkit.
21
-
22
- Usage
23
- -----
24
-
25
- Installation
26
- ------------
27
-
28
- Requirements
29
- ^^^^^^^^^^^^
30
-
31
- Compatibility
32
- -------------
33
-
34
- Licence
35
- -------
36
-
37
- Authors
38
- -------
39
-
40
- `ktools` was written by `fx-kirin <ono.kirin@gmail.com>`_.
41
-
42
- Platform: UNKNOWN
43
- Classifier: Development Status :: 2 - Pre-Alpha
44
- Classifier: Programming Language :: Python
45
- Classifier: Programming Language :: Python :: 2
46
- Classifier: Programming Language :: Python :: 2.7
47
- Classifier: Programming Language :: Python :: 3
48
- Classifier: Programming Language :: Python :: 3.4
49
- Classifier: Programming Language :: Python :: 3.5
50
- Classifier: Programming Language :: Python :: 3.6
51
- Classifier: Programming Language :: Python :: 3.7
52
- Classifier: Programming Language :: Python :: 3.8
53
- Classifier: Programming Language :: Python :: 3.9
54
- Classifier: Programming Language :: Python :: 3.10
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