cykit 0.0.4__tar.gz → 0.0.6__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.
- {cykit-0.0.4/cykit.egg-info → cykit-0.0.6}/PKG-INFO +13 -3
- {cykit-0.0.4 → cykit-0.0.6}/README.md +12 -2
- {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/__init__.py +2 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/__init__.pyi +27 -23
- {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/cylogger.cpp +7139 -4408
- {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/cylogger.pxd +20 -5
- {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/cylogger.pyx +80 -45
- {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/spdlog_logger.hpp +169 -47
- {cykit-0.0.4 → cykit-0.0.6}/cykit/spsc_queue/spsc_queue.pyx +2 -0
- {cykit-0.0.4 → cykit-0.0.6/cykit.egg-info}/PKG-INFO +13 -3
- {cykit-0.0.4 → cykit-0.0.6}/pyproject.toml +1 -1
- {cykit-0.0.4 → cykit-0.0.6}/setup.py +1 -1
- {cykit-0.0.4 → cykit-0.0.6}/LICENSE-APACHE +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/LICENSE-MIT +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/MANIFEST.in +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/__init__.py +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/common.cpp +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/common.pxd +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/common.pyx +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/CMakeLists.txt +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/__init__.pxd +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/color.pxd +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/color.py +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/spdlog_logger.cpp +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/spsc_queue/__init__.pxd +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/spsc_queue/__init__.py +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/spsc_queue/spsc_queue.cpp +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/spsc_queue/spsc_queue.pxd +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/utils/__init__.py +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/utils/compat.pxd +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/utils/msgbridge/__init__.pxd +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/utils/msgbridge/__init__.py +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/utils/msgbridge/msgbridge.cpp +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/utils/msgbridge/msgbridge.pxd +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit/utils/msgbridge/msgbridge.pyx +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit.egg-info/SOURCES.txt +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit.egg-info/dependency_links.txt +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit.egg-info/not-zip-safe +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/cykit.egg-info/top_level.txt +0 -0
- {cykit-0.0.4 → cykit-0.0.6}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cykit
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.6
|
|
4
4
|
Summary: Cython utilities collection
|
|
5
5
|
Author-email: Tapan Hazarika <tapanhaz@gmail.com>
|
|
6
6
|
License: MIT OR Apache-2.0
|
|
@@ -30,12 +30,21 @@ Dynamic: license-file
|
|
|
30
30
|
[](https://github.com/Tapanhaz/cykit/blob/main/LICENSE-MIT)
|
|
31
31
|
[](https://github.com/Tapanhaz/cykit/blob/main/LICENSE-APACHE)
|
|
32
32
|
[](https://github.com/psf/black)
|
|
33
|
+
[](https://pepy.tech/project/cykit)
|
|
33
34
|
|
|
34
35
|
`cykit` is a collection cython utilities.
|
|
35
36
|
|
|
36
37
|
⚠️ **Warning:** This package is currently in an early phase of development.
|
|
37
38
|
APIs are unstable and may change without notice.
|
|
38
39
|
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
`cykit` requires python 3.9 or greater. It is available on pypi. For installation run :
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pip install cykit
|
|
46
|
+
```
|
|
47
|
+
|
|
39
48
|
## Components
|
|
40
49
|
|
|
41
50
|
## cykit.cylogger
|
|
@@ -43,7 +52,7 @@ APIs are unstable and may change without notice.
|
|
|
43
52
|
`cylogger` is the initial component of the `cykit` collection.
|
|
44
53
|
It is a thin wrapper around [spdlog](https://github.com/gabime/spdlog).
|
|
45
54
|
|
|
46
|
-
Detailed examples can be found here: [cykit/examples/cylogger](https://github.com/Tapanhaz/cykit/examples/cylogger)
|
|
55
|
+
Detailed examples can be found here: [cykit/examples/cylogger](https://github.com/Tapanhaz/cykit/tree/main/examples/cylogger)
|
|
47
56
|
|
|
48
57
|
## Contribution
|
|
49
58
|
|
|
@@ -51,4 +60,5 @@ Contributions are welcome! Any kind of help — bug reports / suggestions, featu
|
|
|
51
60
|
|
|
52
61
|
## License
|
|
53
62
|
|
|
54
|
-
This project is licensed under the MIT and/or
|
|
63
|
+
This project is licensed under the [MIT License](LICENSE-MIT) and/or
|
|
64
|
+
[Apache License 2.0](LICENSE-APACHE). See the license files for details.
|
|
@@ -6,12 +6,21 @@
|
|
|
6
6
|
[](https://github.com/Tapanhaz/cykit/blob/main/LICENSE-MIT)
|
|
7
7
|
[](https://github.com/Tapanhaz/cykit/blob/main/LICENSE-APACHE)
|
|
8
8
|
[](https://github.com/psf/black)
|
|
9
|
+
[](https://pepy.tech/project/cykit)
|
|
9
10
|
|
|
10
11
|
`cykit` is a collection cython utilities.
|
|
11
12
|
|
|
12
13
|
⚠️ **Warning:** This package is currently in an early phase of development.
|
|
13
14
|
APIs are unstable and may change without notice.
|
|
14
15
|
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
`cykit` requires python 3.9 or greater. It is available on pypi. For installation run :
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install cykit
|
|
22
|
+
```
|
|
23
|
+
|
|
15
24
|
## Components
|
|
16
25
|
|
|
17
26
|
## cykit.cylogger
|
|
@@ -19,7 +28,7 @@ APIs are unstable and may change without notice.
|
|
|
19
28
|
`cylogger` is the initial component of the `cykit` collection.
|
|
20
29
|
It is a thin wrapper around [spdlog](https://github.com/gabime/spdlog).
|
|
21
30
|
|
|
22
|
-
Detailed examples can be found here: [cykit/examples/cylogger](https://github.com/Tapanhaz/cykit/examples/cylogger)
|
|
31
|
+
Detailed examples can be found here: [cykit/examples/cylogger](https://github.com/Tapanhaz/cykit/tree/main/examples/cylogger)
|
|
23
32
|
|
|
24
33
|
## Contribution
|
|
25
34
|
|
|
@@ -27,4 +36,5 @@ Contributions are welcome! Any kind of help — bug reports / suggestions, featu
|
|
|
27
36
|
|
|
28
37
|
## License
|
|
29
38
|
|
|
30
|
-
This project is licensed under the MIT and/or
|
|
39
|
+
This project is licensed under the [MIT License](LICENSE-MIT) and/or
|
|
40
|
+
[Apache License 2.0](LICENSE-APACHE). See the license files for details.
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
from typing import Optional, Literal, List
|
|
2
|
+
from enum import IntEnum
|
|
2
3
|
|
|
3
|
-
Level
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
]
|
|
4
|
+
class Level(IntEnum):
|
|
5
|
+
TRACE = ...
|
|
6
|
+
DEBUG = ...
|
|
7
|
+
INFO = ...
|
|
8
|
+
WARN = ...
|
|
9
|
+
ERROR = ...
|
|
10
|
+
CRITICAL = ...
|
|
11
|
+
OFF = ...
|
|
12
12
|
|
|
13
13
|
class LogHandler:
|
|
14
14
|
color: bool
|
|
15
15
|
pattern: str
|
|
16
|
-
level:
|
|
16
|
+
level: Level
|
|
17
17
|
|
|
18
18
|
def __init__(
|
|
19
19
|
self,
|
|
20
20
|
color: bool = True,
|
|
21
21
|
pattern: str = "[%Y-%m-%d %H:%M:%S.%e] [%n] [%^%l%$] %v",
|
|
22
|
-
level:
|
|
22
|
+
level: Level = Level.TRACE,
|
|
23
23
|
) -> None: ...
|
|
24
24
|
|
|
25
25
|
class StdoutHandler(LogHandler):
|
|
26
|
-
max_level:
|
|
26
|
+
max_level: Level
|
|
27
27
|
|
|
28
28
|
def __init__(
|
|
29
29
|
self,
|
|
30
30
|
color: bool = False,
|
|
31
31
|
pattern: str = "[%Y-%m-%d %H:%M:%S.%e] [%n] [%^%l%$] %v",
|
|
32
|
-
level:
|
|
33
|
-
max_level:
|
|
32
|
+
level: Level = Level.TRACE,
|
|
33
|
+
max_level: Level = Level.INFO,
|
|
34
34
|
) -> None: ...
|
|
35
35
|
|
|
36
36
|
class StderrHandler(LogHandler):
|
|
@@ -38,7 +38,7 @@ class StderrHandler(LogHandler):
|
|
|
38
38
|
self,
|
|
39
39
|
color: bool = False,
|
|
40
40
|
pattern: str = "[%Y-%m-%d %H:%M:%S.%e] [%n] [%^%l%$] %v",
|
|
41
|
-
level:
|
|
41
|
+
level: Level = Level.WARN,
|
|
42
42
|
) -> None: ...
|
|
43
43
|
|
|
44
44
|
class BasicConsoleHandler(LogHandler):
|
|
@@ -46,19 +46,19 @@ class BasicConsoleHandler(LogHandler):
|
|
|
46
46
|
self,
|
|
47
47
|
color: bool = False,
|
|
48
48
|
pattern: str = "[%Y-%m-%d %H:%M:%S.%e] [%n] [%^%l%$] %v",
|
|
49
|
-
level:
|
|
49
|
+
level: Level = Level.TRACE,
|
|
50
50
|
) -> None: ...
|
|
51
51
|
|
|
52
52
|
class ConsoleHandler(LogHandler):
|
|
53
|
-
max_stdout_level:
|
|
54
|
-
min_level:
|
|
53
|
+
max_stdout_level: Level
|
|
54
|
+
min_level: Level
|
|
55
55
|
|
|
56
56
|
def __init__(
|
|
57
57
|
self,
|
|
58
58
|
color: bool = True,
|
|
59
59
|
pattern: str = "[%Y-%m-%d %H:%M:%S.%e] [%n] [%^%l%$] %v",
|
|
60
|
-
max_stdout_level:
|
|
61
|
-
min_level:
|
|
60
|
+
max_stdout_level: Level = Level.INFO,
|
|
61
|
+
min_level: Level = Level.TRACE,
|
|
62
62
|
) -> None: ...
|
|
63
63
|
|
|
64
64
|
class FileHandler(LogHandler):
|
|
@@ -70,7 +70,7 @@ class FileHandler(LogHandler):
|
|
|
70
70
|
filename: str,
|
|
71
71
|
color: bool = False,
|
|
72
72
|
pattern: str = "[%Y-%m-%d %H:%M:%S.%e] [%n] [%^%l%$] %v",
|
|
73
|
-
level:
|
|
73
|
+
level: Level = Level.TRACE,
|
|
74
74
|
overwrite: bool = False,
|
|
75
75
|
) -> None: ...
|
|
76
76
|
|
|
@@ -82,7 +82,7 @@ class RotatingFileHandler(FileHandler):
|
|
|
82
82
|
self,
|
|
83
83
|
filename: str,
|
|
84
84
|
pattern: str = "[%Y-%m-%d %H:%M:%S.%e] [%n] [%^%l%$] %v",
|
|
85
|
-
level:
|
|
85
|
+
level: Level = Level.TRACE,
|
|
86
86
|
max_size: int = 1048576,
|
|
87
87
|
max_files: int = 3,
|
|
88
88
|
) -> None: ...
|
|
@@ -109,11 +109,15 @@ class Logger:
|
|
|
109
109
|
def __init__(
|
|
110
110
|
self,
|
|
111
111
|
name: str,
|
|
112
|
-
level: Level =
|
|
112
|
+
level: Level = Level.TRACE,
|
|
113
113
|
handlers: Optional[List] = [],
|
|
114
114
|
color_scheme: Optional[ColorScheme] = None,
|
|
115
115
|
set_default: bool = False,
|
|
116
|
+
intercept_stdlib_logging: bool = True,
|
|
116
117
|
) -> None: ...
|
|
118
|
+
"""
|
|
119
|
+
intercept_stdlib_logging will work only when set_default= True
|
|
120
|
+
"""
|
|
117
121
|
def trace(
|
|
118
122
|
self,
|
|
119
123
|
msg: str,
|