shadowshell 0.0.20__tar.gz → 0.0.29__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 (24) hide show
  1. {shadowshell-0.0.20 → shadowshell-0.0.29}/PKG-INFO +6 -8
  2. {shadowshell-0.0.20 → shadowshell-0.0.29}/README.md +1 -3
  3. {shadowshell-0.0.20 → shadowshell-0.0.29}/pyproject.toml +7 -5
  4. shadowshell-0.0.29/src/shadowshell/__init__.py +14 -0
  5. shadowshell-0.0.29/src/shadowshell/bootstrap.py +106 -0
  6. shadowshell-0.0.29/src/shadowshell/configurator.py +31 -0
  7. {shadowshell-0.0.20/src/shadowshell/logutil → shadowshell-0.0.29/src/shadowshell}/console_logger.py +1 -1
  8. {shadowshell-0.0.20/src/shadowshell/logutil → shadowshell-0.0.29/src/shadowshell}/logger_factory.py +5 -1
  9. shadowshell-0.0.29/src/shadowshell/stock_trader.py +16 -0
  10. {shadowshell-0.0.20 → shadowshell-0.0.29}/src/shadowshell.egg-info/PKG-INFO +6 -8
  11. {shadowshell-0.0.20 → shadowshell-0.0.29}/src/shadowshell.egg-info/SOURCES.txt +5 -5
  12. shadowshell-0.0.29/src/shadowshell.egg-info/requires.txt +1 -0
  13. shadowshell-0.0.29/tests/tests.py +28 -0
  14. shadowshell-0.0.20/src/shadowshell/__init__.py +0 -14
  15. shadowshell-0.0.20/src/shadowshell/logutil/__init__.py +0 -12
  16. shadowshell-0.0.20/src/shadowshell/shadowshell.py +0 -66
  17. shadowshell-0.0.20/src/shadowshell/stock_trader.py +0 -16
  18. shadowshell-0.0.20/src/shadowshell.egg-info/requires.txt +0 -1
  19. shadowshell-0.0.20/tests/tests.py +0 -15
  20. {shadowshell-0.0.20 → shadowshell-0.0.29}/setup.cfg +0 -0
  21. {shadowshell-0.0.20 → shadowshell-0.0.29}/src/shadowshell/git_shell.py +0 -0
  22. {shadowshell-0.0.20/src/shadowshell/logutil → shadowshell-0.0.29/src/shadowshell}/logger.py +0 -0
  23. {shadowshell-0.0.20 → shadowshell-0.0.29}/src/shadowshell.egg-info/dependency_links.txt +0 -0
  24. {shadowshell-0.0.20 → shadowshell-0.0.29}/src/shadowshell.egg-info/top_level.txt +0 -0
@@ -1,20 +1,18 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: shadowshell
3
- Version: 0.0.20
4
- Summary: shadowshell.xyz
5
- Author-email: shadowshell <shadowshell@foxmail.com>
3
+ Version: 0.0.29
4
+ Summary: www.shadowshell.xyz
5
+ Author-email: shadowshell <shadowshellxyz@foxmail.com>
6
6
  License: MIT
7
7
  Classifier: Programming Language :: Python :: 3
8
8
  Classifier: Operating System :: OS Independent
9
9
  Requires-Python: >=3.6
10
10
  Description-Content-Type: text/markdown
11
- Requires-Dist: requests
12
-
13
-
11
+ Requires-Dist: configparser
14
12
 
15
13
  # Install
16
14
 
17
- ``` BASH
15
+ ``` shell
18
16
 
19
17
  > pip3 install shadowshell --upgrade
20
18
 
@@ -1,8 +1,6 @@
1
-
2
-
3
1
  # Install
4
2
 
5
- ``` BASH
3
+ ``` shell
6
4
 
7
5
  > pip3 install shadowshell --upgrade
8
6
 
@@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "shadowshell" # 全局唯一名称(检查PyPI是否被占用)
7
- # version = "0.0.16" # 版本号(每次更新需递增)
8
- version = "0.0.20" # 版本号(每次更新需递增)
9
- authors = [{ name = "shadowshell", email = "shadowshell@foxmail.com" }]
10
- description = "shadowshell.xyz"
7
+ #version = "0.0.24" # 版本号(每次更新需递增)
8
+ version = "0.0.29" # 版本号(每次更新需递增)
9
+ authors = [{ name = "shadowshell", email = "shadowshellxyz@foxmail.com" }]
10
+ description = "www.shadowshell.xyz"
11
11
  readme = "README.md"
12
12
  requires-python = ">=3.6" # 支持的Python版本
13
13
  license = { text = "MIT" } # 协议类型
@@ -15,7 +15,9 @@ classifiers = [ # 分类标签(可选)
15
15
  "Programming Language :: Python :: 3",
16
16
  "Operating System :: OS Independent",
17
17
  ]
18
- dependencies = ["requests"] # 依赖库(如 ["requests>=2.25"])
18
+ dependencies = [
19
+ "configparser"
20
+ ] # 依赖库(如 ["requests>=2.25"])
19
21
 
20
22
  # 关键配置:指定包路径和自动发现规则
21
23
  [tool.setuptools]
@@ -0,0 +1,14 @@
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
+ from shadowshell.configurator import Configurator
13
+
14
+ __all__ = ['ShadowShell', 'hello', 'shadowshell', 'Configurator', 'invoke_with_tmpl', 'TestTemplate', 'Logger', 'LoggerFactory', 'GitShell', 'testserver', 'cnnserver']
@@ -0,0 +1,106 @@
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
+ self.logger = LoggerFactory().get_logger()
18
+ pass
19
+
20
+ def hello(self):
21
+ print("Hi, i am shadow shell." )
22
+ current_time = datetime.now()
23
+ formatted_current_time = current_time.strftime("%Y-%m-%d %H:%M:%S")
24
+ print("Now is " + formatted_current_time)
25
+
26
+ def test(self, func, **args):
27
+ try:
28
+ self.logger.debug('-->> Ready')
29
+ func(**args)
30
+ self. logger.debug('-->> Do something')
31
+ except Exception as e:
32
+ self.logger.error(e)
33
+ except:
34
+ self.logger.error(sys.exc_info()[0])
35
+ finally:
36
+ self.logger.debug('-->> Done')
37
+ return
38
+
39
+ # def request(self):
40
+ # print(requests.get("https://wwww.baidu.com"))
41
+
42
+ from shadowshell.logger_factory import LoggerFactory
43
+ import sys
44
+
45
+ class TestTemplate:
46
+
47
+ def __init__(self):
48
+ self.logger = LoggerFactory().get_logger()
49
+ return
50
+
51
+ def test(self):
52
+
53
+ try:
54
+ self.logger.debug('-->> Ready')
55
+
56
+ self.test0()
57
+
58
+ self.logger.debug('-->> Do something')
59
+
60
+ except Exception as e:
61
+ self.logger.error(e)
62
+ except:
63
+ self.logger.error(sys.exc_info()[0])
64
+ finally:
65
+ self.logger.debug('-->> Done')
66
+ return
67
+
68
+ def test0(self):
69
+ self.logger.debug('Nothing')
70
+ return
71
+
72
+ logger = LoggerFactory().get_logger()
73
+
74
+ def testserver():
75
+ os.system("ping shadowshell.xyz")
76
+
77
+ def cnnserver():
78
+ os.system("ssh admin@shadowshell.xyz")
79
+
80
+ def hello(**args):
81
+ logger.info(f"Hello {args}")
82
+
83
+ def shadowshell(**args):
84
+ logger.info(f"shadow shell : {args}")
85
+
86
+ def invoke_with_tmpl(func, **args):
87
+ try:
88
+ logger.debug('-->> Ready')
89
+
90
+ func(**args)
91
+
92
+ logger.debug('-->> Do something')
93
+ except Exception as e:
94
+ logger.error(e)
95
+ except:
96
+ logger.error(sys.exc_info()[0])
97
+ finally:
98
+ logger.debug('-->> Done')
99
+ return
100
+
101
+ if __name__ == "__main__":
102
+ #ShadowShell().test()
103
+ invoke_with_tmpl(shadowshell)
104
+ invoke_with_tmpl(shadowshell, a='1')
105
+ invoke_with_tmpl(shadowshell, a='1', b='2')
106
+ invoke_with_tmpl(hello, a='shell', b='shadow')
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+
4
+ """
5
+ Configurator
6
+ @author: shadow walker
7
+ """
8
+
9
+ import configparser
10
+
11
+ from shadowshell import LoggerFactory
12
+
13
+ class Configurator:
14
+
15
+ config = None;
16
+
17
+ def __init__(self, config_file):
18
+
19
+ self.logger = LoggerFactory().get_logger()
20
+
21
+ # 加载配置文件
22
+ self.config = configparser.ConfigParser()
23
+ self.config.read(config_file)
24
+ self.logger.debug("load and read config file : %s." % (config_file))
25
+
26
+ def get(self, group, key):
27
+ value = self.config.get(group, key)
28
+ self.logger.debug("group -> %s, key -> %s, value -> %s" % (group, key, value))
29
+ return value
30
+
31
+
@@ -7,7 +7,7 @@ ConsoleLogger
7
7
  author: shadow shell
8
8
  """
9
9
 
10
- from .logger import Logger
10
+ from shadowshell.logger import Logger
11
11
 
12
12
  class ConsoleLogger(Logger):
13
13
 
@@ -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,20 +1,18 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: shadowshell
3
- Version: 0.0.20
4
- Summary: shadowshell.xyz
5
- Author-email: shadowshell <shadowshell@foxmail.com>
3
+ Version: 0.0.29
4
+ Summary: www.shadowshell.xyz
5
+ Author-email: shadowshell <shadowshellxyz@foxmail.com>
6
6
  License: MIT
7
7
  Classifier: Programming Language :: Python :: 3
8
8
  Classifier: Operating System :: OS Independent
9
9
  Requires-Python: >=3.6
10
10
  Description-Content-Type: text/markdown
11
- Requires-Dist: requests
12
-
13
-
11
+ Requires-Dist: configparser
14
12
 
15
13
  # Install
16
14
 
17
- ``` BASH
15
+ ``` shell
18
16
 
19
17
  > pip3 install shadowshell --upgrade
20
18
 
@@ -1,16 +1,16 @@
1
1
  README.md
2
2
  pyproject.toml
3
3
  src/shadowshell/__init__.py
4
+ src/shadowshell/bootstrap.py
5
+ src/shadowshell/configurator.py
6
+ src/shadowshell/console_logger.py
4
7
  src/shadowshell/git_shell.py
5
- src/shadowshell/shadowshell.py
8
+ src/shadowshell/logger.py
9
+ src/shadowshell/logger_factory.py
6
10
  src/shadowshell/stock_trader.py
7
11
  src/shadowshell.egg-info/PKG-INFO
8
12
  src/shadowshell.egg-info/SOURCES.txt
9
13
  src/shadowshell.egg-info/dependency_links.txt
10
14
  src/shadowshell.egg-info/requires.txt
11
15
  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
16
  tests/tests.py
@@ -0,0 +1 @@
1
+ configparser
@@ -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, TestTemplate, 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', 'TestTemplate', '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,66 +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
- class TestTemplate:
31
-
32
- def __init__(self):
33
- return
34
-
35
- def test(self):
36
-
37
- try:
38
- self.console('-->> Ready')
39
-
40
- self.test0()
41
-
42
- self.console('-->> Do something')
43
-
44
- except Exception as e:
45
- self.console(e)
46
- except:
47
- self.console(sys.exc_info()[0])
48
- finally:
49
- self.console('-->> Done')
50
- return
51
-
52
- def test0(self):
53
- self.console('Nothing')
54
- return
55
-
56
- def console(self, content):
57
- print('[CONSOLE] %s' % (content))
58
-
59
- def testserver():
60
- os.system("ping shadowshell.xyz")
61
-
62
- def cnnserver():
63
- os.system("ssh admin@shadowshell.xyz")
64
-
65
- if __name__ == "__main__":
66
- 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
-
@@ -1 +0,0 @@
1
- requests
@@ -1,15 +0,0 @@
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
- ShadowShell().hello()
13
-
14
- cnnserver()
15
-
File without changes