sciveo 0.1.10__tar.gz → 0.1.12__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.
- {sciveo-0.1.10 → sciveo-0.1.12}/PKG-INFO +15 -4
- {sciveo-0.1.10 → sciveo-0.1.12}/README.md +14 -3
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/cli.py +2 -2
- sciveo-0.1.12/sciveo/common/tools/logger.py +47 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/common/tools/timers.py +3 -1
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/monitoring/monitor.py +1 -1
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/monitoring/network.py +3 -2
- sciveo-0.1.12/sciveo/version.py +2 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo.egg-info/PKG-INFO +15 -4
- sciveo-0.1.10/sciveo/common/tools/logger.py +0 -47
- sciveo-0.1.10/sciveo/version.py +0 -2
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/__init__.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/api/__init__.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/api/base.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/api/upload.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/common/__init__.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/common/configuration.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/common/model.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/common/optimizers.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/common/sampling.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/common/tools/__init__.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/common/tools/configuration.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/common/tools/daemon.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/common/tools/formating.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/common/tools/hardware.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/common/tools/synchronized.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/content/__init__.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/content/dataset.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/content/experiment.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/content/project.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/content/runner.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/monitoring/__init__.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo/monitoring/start.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo.egg-info/SOURCES.txt +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo.egg-info/dependency_links.txt +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo.egg-info/entry_points.txt +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo.egg-info/requires.txt +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/sciveo.egg-info/top_level.txt +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/setup.cfg +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/setup.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/test/test_configuration.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/test/test_monitoring.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/test/test_runner.py +0 -0
- {sciveo-0.1.10 → sciveo-0.1.12}/test/test_sampling.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sciveo
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.12
|
|
4
4
|
Description-Content-Type: text/markdown
|
|
5
5
|
Provides-Extra: mon
|
|
6
6
|
Provides-Extra: net
|
|
@@ -47,12 +47,18 @@ The library has local and remote mode. The local one is ready to use, but for th
|
|
|
47
47
|
|
|
48
48
|
When have sciveo account:
|
|
49
49
|
```shell
|
|
50
|
+
sciveo init
|
|
51
|
+
```
|
|
52
|
+
Where ~/.sciveo/ path and ~/.sciveo/default file will be created. Just need to change the secret_access_key value.
|
|
53
|
+
|
|
54
|
+
or
|
|
55
|
+
```shell
|
|
50
56
|
export SCIVEO_SECRET_ACCESS_KEY='my_sciveo_user_auth_token'
|
|
51
57
|
```
|
|
52
58
|
or create a file like ~/.sciveo/some_file_name where put:
|
|
53
59
|
secret_access_key=my_sciveo_user_auth_token
|
|
54
60
|
|
|
55
|
-
|
|
61
|
+
Sciveo Monitoring cli
|
|
56
62
|
```shell
|
|
57
63
|
sciveo monitor --period 120
|
|
58
64
|
```
|
|
@@ -64,12 +70,17 @@ import sciveo
|
|
|
64
70
|
# Non blocking monitoring, so continue the code execution after it.
|
|
65
71
|
sciveo.monitor(period=120, block=False)
|
|
66
72
|
|
|
67
|
-
#rest of your code here
|
|
73
|
+
#rest of your python code here
|
|
68
74
|
|
|
75
|
+
```
|
|
69
76
|
|
|
77
|
+
Sciveo Scan hosts port tool available
|
|
78
|
+
```shell
|
|
79
|
+
sciveo scan --port 22 --timeout 0.5
|
|
70
80
|
```
|
|
71
81
|
|
|
72
|
-
|
|
82
|
+
|
|
83
|
+
Experimental Projects management
|
|
73
84
|
|
|
74
85
|
```python
|
|
75
86
|
|
|
@@ -39,12 +39,18 @@ The library has local and remote mode. The local one is ready to use, but for th
|
|
|
39
39
|
|
|
40
40
|
When have sciveo account:
|
|
41
41
|
```shell
|
|
42
|
+
sciveo init
|
|
43
|
+
```
|
|
44
|
+
Where ~/.sciveo/ path and ~/.sciveo/default file will be created. Just need to change the secret_access_key value.
|
|
45
|
+
|
|
46
|
+
or
|
|
47
|
+
```shell
|
|
42
48
|
export SCIVEO_SECRET_ACCESS_KEY='my_sciveo_user_auth_token'
|
|
43
49
|
```
|
|
44
50
|
or create a file like ~/.sciveo/some_file_name where put:
|
|
45
51
|
secret_access_key=my_sciveo_user_auth_token
|
|
46
52
|
|
|
47
|
-
|
|
53
|
+
Sciveo Monitoring cli
|
|
48
54
|
```shell
|
|
49
55
|
sciveo monitor --period 120
|
|
50
56
|
```
|
|
@@ -56,12 +62,17 @@ import sciveo
|
|
|
56
62
|
# Non blocking monitoring, so continue the code execution after it.
|
|
57
63
|
sciveo.monitor(period=120, block=False)
|
|
58
64
|
|
|
59
|
-
#rest of your code here
|
|
65
|
+
#rest of your python code here
|
|
60
66
|
|
|
67
|
+
```
|
|
61
68
|
|
|
69
|
+
Sciveo Scan hosts port tool available
|
|
70
|
+
```shell
|
|
71
|
+
sciveo scan --port 22 --timeout 0.5
|
|
62
72
|
```
|
|
63
73
|
|
|
64
|
-
|
|
74
|
+
|
|
75
|
+
Experimental Projects management
|
|
65
76
|
|
|
66
77
|
```python
|
|
67
78
|
|
|
@@ -28,7 +28,7 @@ def main():
|
|
|
28
28
|
parser.add_argument('--period', type=int, default=120, help='Period in seconds')
|
|
29
29
|
parser.add_argument('--block', type=bool, default=True, help='Block flag')
|
|
30
30
|
parser.add_argument('--auth', type=str, default=config['secret_access_key'], help='Auth secret access key')
|
|
31
|
-
parser.add_argument('--timeout', type=float, default=0
|
|
31
|
+
parser.add_argument('--timeout', type=float, default=1.0, help='Timeout')
|
|
32
32
|
parser.add_argument('--port', type=int, default=22, help='Host port number, used for network ops')
|
|
33
33
|
parser.add_argument('--localhost', type=bool, default=False, help='Add localhost to list of hosts')
|
|
34
34
|
args = parser.parse_args()
|
|
@@ -47,7 +47,7 @@ def main():
|
|
|
47
47
|
"api_base_url=https://sciveo.com",
|
|
48
48
|
"log_min_level=DEBUG"
|
|
49
49
|
]
|
|
50
|
-
with open("default", 'w') as fp:
|
|
50
|
+
with open(os.path.join(base_path, "default"), 'w') as fp:
|
|
51
51
|
for line in default_lines:
|
|
52
52
|
fp.write(line + '\n')
|
|
53
53
|
else:
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Pavlin Georgiev, Softel Labs
|
|
3
|
+
#
|
|
4
|
+
# This is a proprietary file and may not be copied,
|
|
5
|
+
# distributed, or modified without express permission
|
|
6
|
+
# from the owner. For licensing inquiries, please
|
|
7
|
+
# contact pavlin@softel.bg.
|
|
8
|
+
#
|
|
9
|
+
# 2023
|
|
10
|
+
#
|
|
11
|
+
|
|
12
|
+
import os
|
|
13
|
+
import logging
|
|
14
|
+
from threading import Lock
|
|
15
|
+
|
|
16
|
+
from sciveo.common.tools.configuration import GlobalConfiguration
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
SCIVEO_LOGGER_NAME = "sciveo-log"
|
|
20
|
+
|
|
21
|
+
_sciveo_global_config = GlobalConfiguration.get()
|
|
22
|
+
_sciveo_log_min_level = _sciveo_global_config["LOG_MIN_LEVEL"]
|
|
23
|
+
_sciveo_log_lock = Lock()
|
|
24
|
+
|
|
25
|
+
def _sciveo_get_logger(name):
|
|
26
|
+
logger = logging.getLogger(name)
|
|
27
|
+
if not logger.hasHandlers():
|
|
28
|
+
with _sciveo_log_lock:
|
|
29
|
+
if not logger.hasHandlers():
|
|
30
|
+
logger.setLevel(logging.getLevelName(_sciveo_log_min_level))
|
|
31
|
+
formatter = logging.Formatter('%(asctime)s [%(thread)d] [%(levelname)s] %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
|
|
32
|
+
ch = logging.StreamHandler()
|
|
33
|
+
ch.setFormatter(formatter)
|
|
34
|
+
logger.addHandler(ch)
|
|
35
|
+
logger.propagate = False
|
|
36
|
+
return logger
|
|
37
|
+
|
|
38
|
+
def debug(*args):
|
|
39
|
+
_sciveo_get_logger(SCIVEO_LOGGER_NAME).debug(args)
|
|
40
|
+
def info(*args):
|
|
41
|
+
_sciveo_get_logger(SCIVEO_LOGGER_NAME).info(args)
|
|
42
|
+
def warning(*args):
|
|
43
|
+
_sciveo_get_logger(SCIVEO_LOGGER_NAME).warning(args)
|
|
44
|
+
def error(*args):
|
|
45
|
+
_sciveo_get_logger(SCIVEO_LOGGER_NAME).error(args)
|
|
46
|
+
def critical(*args):
|
|
47
|
+
_sciveo_get_logger(SCIVEO_LOGGER_NAME).critical(args)
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
import time
|
|
13
13
|
|
|
14
|
+
from sciveo.common.tools.logger import *
|
|
15
|
+
|
|
14
16
|
|
|
15
17
|
class FPSCounter:
|
|
16
18
|
def __init__(self, period=10, tag=""):
|
|
@@ -23,7 +25,7 @@ class FPSCounter:
|
|
|
23
25
|
self.n += 1
|
|
24
26
|
t2 = time.time()
|
|
25
27
|
if t2 - self.t1 > self.period:
|
|
26
|
-
|
|
28
|
+
debug(type(self).__name__, self.tag, "FPS", self.n / (t2 - self.t1))
|
|
27
29
|
self.n = 0
|
|
28
30
|
self.t1 = time.time()
|
|
29
31
|
|
|
@@ -19,7 +19,7 @@ from sciveo.common.tools.timers import Timer
|
|
|
19
19
|
class NetworkTools:
|
|
20
20
|
def __init__(self, **kwargs):
|
|
21
21
|
self.default_arguments = {
|
|
22
|
-
"timeout": 0
|
|
22
|
+
"timeout": 1.0,
|
|
23
23
|
"localhost": False,
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -65,6 +65,7 @@ class NetworkTools:
|
|
|
65
65
|
self.scan_port_hosts(list_ip, port)
|
|
66
66
|
if self.arguments["localhost"]:
|
|
67
67
|
self.scan_port_hosts(["127.0.0.1"], port)
|
|
68
|
+
self.data["scan"][port].sort(key=lambda ip: int(ip.split('.')[-1]))
|
|
68
69
|
debug(type(self).__name__, f"scan_port [{port}] elapsed time {t.stop():.1f}s", self.data["scan"][port])
|
|
69
70
|
return self.data["scan"][port]
|
|
70
71
|
|
|
@@ -92,4 +93,4 @@ class NetworkTools:
|
|
|
92
93
|
|
|
93
94
|
|
|
94
95
|
if __name__ == "__main__":
|
|
95
|
-
|
|
96
|
+
debug(NetworkTools(timeout=1.0, localhost=False).scan_port(port=9901))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sciveo
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.12
|
|
4
4
|
Description-Content-Type: text/markdown
|
|
5
5
|
Provides-Extra: mon
|
|
6
6
|
Provides-Extra: net
|
|
@@ -47,12 +47,18 @@ The library has local and remote mode. The local one is ready to use, but for th
|
|
|
47
47
|
|
|
48
48
|
When have sciveo account:
|
|
49
49
|
```shell
|
|
50
|
+
sciveo init
|
|
51
|
+
```
|
|
52
|
+
Where ~/.sciveo/ path and ~/.sciveo/default file will be created. Just need to change the secret_access_key value.
|
|
53
|
+
|
|
54
|
+
or
|
|
55
|
+
```shell
|
|
50
56
|
export SCIVEO_SECRET_ACCESS_KEY='my_sciveo_user_auth_token'
|
|
51
57
|
```
|
|
52
58
|
or create a file like ~/.sciveo/some_file_name where put:
|
|
53
59
|
secret_access_key=my_sciveo_user_auth_token
|
|
54
60
|
|
|
55
|
-
|
|
61
|
+
Sciveo Monitoring cli
|
|
56
62
|
```shell
|
|
57
63
|
sciveo monitor --period 120
|
|
58
64
|
```
|
|
@@ -64,12 +70,17 @@ import sciveo
|
|
|
64
70
|
# Non blocking monitoring, so continue the code execution after it.
|
|
65
71
|
sciveo.monitor(period=120, block=False)
|
|
66
72
|
|
|
67
|
-
#rest of your code here
|
|
73
|
+
#rest of your python code here
|
|
68
74
|
|
|
75
|
+
```
|
|
69
76
|
|
|
77
|
+
Sciveo Scan hosts port tool available
|
|
78
|
+
```shell
|
|
79
|
+
sciveo scan --port 22 --timeout 0.5
|
|
70
80
|
```
|
|
71
81
|
|
|
72
|
-
|
|
82
|
+
|
|
83
|
+
Experimental Projects management
|
|
73
84
|
|
|
74
85
|
```python
|
|
75
86
|
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
#
|
|
2
|
-
# Pavlin Georgiev, Softel Labs
|
|
3
|
-
#
|
|
4
|
-
# This is a proprietary file and may not be copied,
|
|
5
|
-
# distributed, or modified without express permission
|
|
6
|
-
# from the owner. For licensing inquiries, please
|
|
7
|
-
# contact pavlin@softel.bg.
|
|
8
|
-
#
|
|
9
|
-
# 2023
|
|
10
|
-
#
|
|
11
|
-
|
|
12
|
-
import os
|
|
13
|
-
import logging
|
|
14
|
-
import threading
|
|
15
|
-
|
|
16
|
-
from sciveo.common.tools.configuration import GlobalConfiguration
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
config = GlobalConfiguration.get()
|
|
20
|
-
log_min_level = config["LOG_MIN_LEVEL"]
|
|
21
|
-
|
|
22
|
-
def get_logger(name):
|
|
23
|
-
logger = logging.getLogger(name)
|
|
24
|
-
|
|
25
|
-
if not logger.handlers:
|
|
26
|
-
logger.setLevel(logging.getLevelName(log_min_level))
|
|
27
|
-
formatter = logging.Formatter('%(asctime)s [%(thread)d] [%(levelname)s] %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
|
|
28
|
-
ch = logging.StreamHandler()
|
|
29
|
-
ch.setFormatter(formatter)
|
|
30
|
-
logger.addHandler(ch)
|
|
31
|
-
|
|
32
|
-
return logger
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
SCIVEO_LOGGER_NAME = "sciveo-log"
|
|
37
|
-
|
|
38
|
-
def debug(*args):
|
|
39
|
-
get_logger(SCIVEO_LOGGER_NAME).debug(args)
|
|
40
|
-
def info(*args):
|
|
41
|
-
get_logger(SCIVEO_LOGGER_NAME).info(args)
|
|
42
|
-
def warning(*args):
|
|
43
|
-
get_logger(SCIVEO_LOGGER_NAME).warning(args)
|
|
44
|
-
def error(*args):
|
|
45
|
-
get_logger(SCIVEO_LOGGER_NAME).error(args)
|
|
46
|
-
def critical(*args):
|
|
47
|
-
get_logger(SCIVEO_LOGGER_NAME).critical(args)
|
sciveo-0.1.10/sciveo/version.py
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
|