shadowshell 0.0.19__tar.gz → 0.0.24__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.
- {shadowshell-0.0.19 → shadowshell-0.0.24}/PKG-INFO +1 -2
- {shadowshell-0.0.19 → shadowshell-0.0.24}/README.md +0 -1
- {shadowshell-0.0.19 → shadowshell-0.0.24}/pyproject.toml +2 -2
- shadowshell-0.0.24/src/shadowshell/__init__.py +13 -0
- shadowshell-0.0.24/src/shadowshell/bootstrap.py +93 -0
- {shadowshell-0.0.19/src/shadowshell/logutil → shadowshell-0.0.24/src/shadowshell}/console_logger.py +1 -1
- {shadowshell-0.0.19/src/shadowshell/logutil → shadowshell-0.0.24/src/shadowshell}/logger_factory.py +5 -1
- shadowshell-0.0.24/src/shadowshell/stock_trader.py +16 -0
- {shadowshell-0.0.19 → shadowshell-0.0.24}/src/shadowshell.egg-info/PKG-INFO +1 -2
- {shadowshell-0.0.19 → shadowshell-0.0.24}/src/shadowshell.egg-info/SOURCES.txt +4 -5
- shadowshell-0.0.24/tests/tests.py +28 -0
- shadowshell-0.0.19/src/shadowshell/__init__.py +0 -14
- shadowshell-0.0.19/src/shadowshell/logutil/__init__.py +0 -12
- shadowshell-0.0.19/src/shadowshell/shadowshell.py +0 -37
- shadowshell-0.0.19/src/shadowshell/stock_trader.py +0 -16
- shadowshell-0.0.19/tests/tests.py +0 -15
- {shadowshell-0.0.19 → shadowshell-0.0.24}/setup.cfg +0 -0
- {shadowshell-0.0.19 → shadowshell-0.0.24}/src/shadowshell/git_shell.py +0 -0
- {shadowshell-0.0.19/src/shadowshell/logutil → shadowshell-0.0.24/src/shadowshell}/logger.py +0 -0
- {shadowshell-0.0.19 → shadowshell-0.0.24}/src/shadowshell.egg-info/dependency_links.txt +0 -0
- {shadowshell-0.0.19 → shadowshell-0.0.24}/src/shadowshell.egg-info/requires.txt +0 -0
- {shadowshell-0.0.19 → shadowshell-0.0.24}/src/shadowshell.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: shadowshell
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.24
|
|
4
4
|
Summary: shadowshell.xyz
|
|
5
5
|
Author-email: shadowshell <shadowshell@foxmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -41,4 +41,3 @@ Requires-Dist: requests
|
|
|
41
41
|
|
|
42
42
|
- [Test PYPI](https://test.pypi.org/project/shadowshell/#history)
|
|
43
43
|
|
|
44
|
-
|
|
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "shadowshell" # 全局唯一名称(检查PyPI是否被占用)
|
|
7
|
-
|
|
8
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.24" # 版本号(每次更新需递增)
|
|
8
|
+
#version = "0.0.25" # 版本号(每次更新需递增)
|
|
9
9
|
authors = [{ name = "shadowshell", email = "shadowshell@foxmail.com" }]
|
|
10
10
|
description = "shadowshell.xyz"
|
|
11
11
|
readme = "README.md"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
@author: shadow shell
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from shadowshell.logger import Logger
|
|
9
|
+
from shadowshell.logger_factory import LoggerFactory
|
|
10
|
+
from shadowshell.bootstrap import ShadowShell, hello, shadowshell, invoke_with_tmpl, TestTemplate, testserver, cnnserver
|
|
11
|
+
from shadowshell.git_shell import GitShell
|
|
12
|
+
|
|
13
|
+
__all__ = ['ShadowShell', 'hello', 'shadowshell', 'invoke_with_tmpl', 'TestTemplate', 'Logger', 'LoggerFactory', 'GitShell', 'testserver', 'cnnserver']
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
import os
|
|
5
|
+
# import requests
|
|
6
|
+
from datetime import datetime
|
|
7
|
+
from shadowshell.logger_factory import LoggerFactory
|
|
8
|
+
|
|
9
|
+
"""
|
|
10
|
+
ShadowShell
|
|
11
|
+
|
|
12
|
+
@author: shadow shell
|
|
13
|
+
"""
|
|
14
|
+
class ShadowShell:
|
|
15
|
+
|
|
16
|
+
def __init__(self):
|
|
17
|
+
pass
|
|
18
|
+
|
|
19
|
+
def hello(self):
|
|
20
|
+
print("Hi, i am shadow shell." )
|
|
21
|
+
current_time = datetime.now()
|
|
22
|
+
formatted_current_time = current_time.strftime("%Y-%m-%d %H:%M:%S")
|
|
23
|
+
print("Now is " + formatted_current_time)
|
|
24
|
+
|
|
25
|
+
def test(self):
|
|
26
|
+
self.hello()
|
|
27
|
+
|
|
28
|
+
# def request(self):
|
|
29
|
+
# print(requests.get("https://wwww.baidu.com"))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class TestTemplate:
|
|
33
|
+
|
|
34
|
+
def __init__(self):
|
|
35
|
+
return
|
|
36
|
+
|
|
37
|
+
def test(self):
|
|
38
|
+
|
|
39
|
+
try:
|
|
40
|
+
self.console('-->> Ready')
|
|
41
|
+
|
|
42
|
+
self.test0()
|
|
43
|
+
|
|
44
|
+
self.console('-->> Do something')
|
|
45
|
+
|
|
46
|
+
except Exception as e:
|
|
47
|
+
self.console(e)
|
|
48
|
+
except:
|
|
49
|
+
self.console(sys.exc_info()[0])
|
|
50
|
+
finally:
|
|
51
|
+
self.console('-->> Done')
|
|
52
|
+
return
|
|
53
|
+
|
|
54
|
+
def test0(self):
|
|
55
|
+
self.console('Nothing')
|
|
56
|
+
return
|
|
57
|
+
|
|
58
|
+
def console(self, content):
|
|
59
|
+
print('[CONSOLE] %s' % (content))
|
|
60
|
+
|
|
61
|
+
logger = LoggerFactory().get_logger()
|
|
62
|
+
|
|
63
|
+
def testserver():
|
|
64
|
+
os.system("ping shadowshell.xyz")
|
|
65
|
+
|
|
66
|
+
def cnnserver():
|
|
67
|
+
os.system("ssh admin@shadowshell.xyz")
|
|
68
|
+
|
|
69
|
+
def hello(**args):
|
|
70
|
+
logger.info(f"Hello {args}")
|
|
71
|
+
|
|
72
|
+
def shadowshell(**args):
|
|
73
|
+
logger.info(f"shadow shell : {args}")
|
|
74
|
+
|
|
75
|
+
def invoke_with_tmpl(func, **args):
|
|
76
|
+
try:
|
|
77
|
+
logger.info('-->> Ready')
|
|
78
|
+
func(**args)
|
|
79
|
+
logger.info('-->> Do something')
|
|
80
|
+
except Exception as e:
|
|
81
|
+
logger.error(e)
|
|
82
|
+
except:
|
|
83
|
+
logger.error(sys.exc_info()[0])
|
|
84
|
+
finally:
|
|
85
|
+
logger.info('-->> Done')
|
|
86
|
+
return
|
|
87
|
+
|
|
88
|
+
if __name__ == "__main__":
|
|
89
|
+
#ShadowShell().test()
|
|
90
|
+
invoke_with_tmpl(shadowshell)
|
|
91
|
+
invoke_with_tmpl(shadowshell, a='1')
|
|
92
|
+
invoke_with_tmpl(shadowshell, a='1', b='2')
|
|
93
|
+
invoke_with_tmpl(hello, a='shell', b='shadow')
|
{shadowshell-0.0.19/src/shadowshell/logutil → shadowshell-0.0.24/src/shadowshell}/logger_factory.py
RENAMED
|
@@ -7,7 +7,7 @@ LoggerFactory
|
|
|
7
7
|
@author: shadow shell
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
from .console_logger import ConsoleLogger
|
|
10
|
+
from shadowshell.console_logger import ConsoleLogger
|
|
11
11
|
|
|
12
12
|
class LoggerFactory:
|
|
13
13
|
|
|
@@ -18,3 +18,7 @@ class LoggerFactory:
|
|
|
18
18
|
|
|
19
19
|
def get_logger(self, name = "default"):
|
|
20
20
|
return self.logger
|
|
21
|
+
|
|
22
|
+
if __name__ == "__main__":
|
|
23
|
+
LoggerFactory().get_logger().info("test")
|
|
24
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# #!/usr/bin/env python3
|
|
2
|
+
# # -*- coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
# import akshare as ak
|
|
5
|
+
# import pandas as pd
|
|
6
|
+
|
|
7
|
+
# # 获取美股中概股实时行情
|
|
8
|
+
# df_us = ak.stock_us_spot_em()
|
|
9
|
+
|
|
10
|
+
# target_names = ["哔哩哔哩", "爱奇艺", "京东", "阿里巴巴", "蔚来", "小鹏汽车", "理想汽车"]
|
|
11
|
+
# stocks = df_us[df_us["名称"].isin(target_names)]
|
|
12
|
+
|
|
13
|
+
# print(stocks[["代码", "名称","最新价","涨跌幅","涨跌额","开盘价","最高价","最低价","昨收价","总市值","市盈率","成交量","成交额","振幅","换手率"]])
|
|
14
|
+
|
|
15
|
+
# # df_us.to_csv("/Users/shadowwalker/Desktop/selected_stocks.csv", index=False, encoding="utf_8_sig")
|
|
16
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: shadowshell
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.24
|
|
4
4
|
Summary: shadowshell.xyz
|
|
5
5
|
Author-email: shadowshell <shadowshell@foxmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -41,4 +41,3 @@ Requires-Dist: requests
|
|
|
41
41
|
|
|
42
42
|
- [Test PYPI](https://test.pypi.org/project/shadowshell/#history)
|
|
43
43
|
|
|
44
|
-
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
README.md
|
|
2
2
|
pyproject.toml
|
|
3
3
|
src/shadowshell/__init__.py
|
|
4
|
+
src/shadowshell/bootstrap.py
|
|
5
|
+
src/shadowshell/console_logger.py
|
|
4
6
|
src/shadowshell/git_shell.py
|
|
5
|
-
src/shadowshell/
|
|
7
|
+
src/shadowshell/logger.py
|
|
8
|
+
src/shadowshell/logger_factory.py
|
|
6
9
|
src/shadowshell/stock_trader.py
|
|
7
10
|
src/shadowshell.egg-info/PKG-INFO
|
|
8
11
|
src/shadowshell.egg-info/SOURCES.txt
|
|
9
12
|
src/shadowshell.egg-info/dependency_links.txt
|
|
10
13
|
src/shadowshell.egg-info/requires.txt
|
|
11
14
|
src/shadowshell.egg-info/top_level.txt
|
|
12
|
-
src/shadowshell/logutil/__init__.py
|
|
13
|
-
src/shadowshell/logutil/console_logger.py
|
|
14
|
-
src/shadowshell/logutil/logger.py
|
|
15
|
-
src/shadowshell/logutil/logger_factory.py
|
|
16
15
|
tests/tests.py
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
tests
|
|
6
|
+
|
|
7
|
+
@author: shadow shell
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from shadowshell import *
|
|
11
|
+
|
|
12
|
+
class Test(TestTemplate):
|
|
13
|
+
|
|
14
|
+
def test0(self):
|
|
15
|
+
LoggerFactory().get_logger().info("Run test0")
|
|
16
|
+
return
|
|
17
|
+
|
|
18
|
+
def hello_world(content):
|
|
19
|
+
LoggerFactory().get_logger().info(f"Hello {content}")
|
|
20
|
+
|
|
21
|
+
Test().test()
|
|
22
|
+
ShadowShell().hello()
|
|
23
|
+
# hello()
|
|
24
|
+
# shadowshell()
|
|
25
|
+
|
|
26
|
+
testserver()
|
|
27
|
+
|
|
28
|
+
# invoke_with_tmpl(hello_world, "World")
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
@author: shadow shell
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
from .shadowshell import ShadowShell, testserver, cnnserver
|
|
9
|
-
from .logutil.logger import Logger
|
|
10
|
-
from .logutil.logger_factory import LoggerFactory
|
|
11
|
-
|
|
12
|
-
from .git_shell import GitShell
|
|
13
|
-
|
|
14
|
-
__all__ = ['ShadowShell', 'Logger', 'LoggerFactory', 'GitShell', 'testserver', 'cnnserver']
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
@author: shadow shell
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
from .console_logger import ConsoleLogger
|
|
9
|
-
from .logger import Logger
|
|
10
|
-
from .logger_factory import LoggerFactory
|
|
11
|
-
|
|
12
|
-
__all__ = ['ConsoleLogger', 'Logger', 'LoggerFactory']
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
import os
|
|
5
|
-
import requests
|
|
6
|
-
from datetime import datetime
|
|
7
|
-
|
|
8
|
-
"""
|
|
9
|
-
ShadowShell
|
|
10
|
-
|
|
11
|
-
@author: shadow shell
|
|
12
|
-
"""
|
|
13
|
-
class ShadowShell:
|
|
14
|
-
|
|
15
|
-
def __init__(self):
|
|
16
|
-
pass
|
|
17
|
-
|
|
18
|
-
def hello(self):
|
|
19
|
-
print("Hi, i am shadow shell." )
|
|
20
|
-
current_time = datetime.now()
|
|
21
|
-
formatted_current_time = current_time.strftime("%Y-%m-%d %H:%M:%S")
|
|
22
|
-
print("Now is " + formatted_current_time)
|
|
23
|
-
|
|
24
|
-
def test(self):
|
|
25
|
-
self.hello()
|
|
26
|
-
|
|
27
|
-
def request(self):
|
|
28
|
-
print(requests.get("https://wwww.baidu.com"))
|
|
29
|
-
|
|
30
|
-
def testserver():
|
|
31
|
-
os.system("ping shadowshell.xyz")
|
|
32
|
-
|
|
33
|
-
def cnnserver():
|
|
34
|
-
os.system("ssh admin@shadowshell.xyz")
|
|
35
|
-
|
|
36
|
-
if __name__ == "__main__":
|
|
37
|
-
ShadowShell().test()
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
import akshare as ak
|
|
5
|
-
import pandas as pd
|
|
6
|
-
|
|
7
|
-
# 获取美股中概股实时行情
|
|
8
|
-
df_us = ak.stock_us_spot_em()
|
|
9
|
-
|
|
10
|
-
target_names = ["哔哩哔哩", "爱奇艺", "京东", "阿里巴巴", "蔚来", "小鹏汽车", "理想汽车"]
|
|
11
|
-
stocks = df_us[df_us["名称"].isin(target_names)]
|
|
12
|
-
|
|
13
|
-
print(stocks[["代码", "名称","最新价","涨跌幅","涨跌额","开盘价","最高价","最低价","昨收价","总市值","市盈率","成交量","成交额","振幅","换手率"]])
|
|
14
|
-
|
|
15
|
-
# df_us.to_csv("/Users/shadowwalker/Desktop/selected_stocks.csv", index=False, encoding="utf_8_sig")
|
|
16
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|