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.
Files changed (40) hide show
  1. {cykit-0.0.4/cykit.egg-info → cykit-0.0.6}/PKG-INFO +13 -3
  2. {cykit-0.0.4 → cykit-0.0.6}/README.md +12 -2
  3. {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/__init__.py +2 -0
  4. {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/__init__.pyi +27 -23
  5. {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/cylogger.cpp +7139 -4408
  6. {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/cylogger.pxd +20 -5
  7. {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/cylogger.pyx +80 -45
  8. {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/spdlog_logger.hpp +169 -47
  9. {cykit-0.0.4 → cykit-0.0.6}/cykit/spsc_queue/spsc_queue.pyx +2 -0
  10. {cykit-0.0.4 → cykit-0.0.6/cykit.egg-info}/PKG-INFO +13 -3
  11. {cykit-0.0.4 → cykit-0.0.6}/pyproject.toml +1 -1
  12. {cykit-0.0.4 → cykit-0.0.6}/setup.py +1 -1
  13. {cykit-0.0.4 → cykit-0.0.6}/LICENSE-APACHE +0 -0
  14. {cykit-0.0.4 → cykit-0.0.6}/LICENSE-MIT +0 -0
  15. {cykit-0.0.4 → cykit-0.0.6}/MANIFEST.in +0 -0
  16. {cykit-0.0.4 → cykit-0.0.6}/cykit/__init__.py +0 -0
  17. {cykit-0.0.4 → cykit-0.0.6}/cykit/common.cpp +0 -0
  18. {cykit-0.0.4 → cykit-0.0.6}/cykit/common.pxd +0 -0
  19. {cykit-0.0.4 → cykit-0.0.6}/cykit/common.pyx +0 -0
  20. {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/CMakeLists.txt +0 -0
  21. {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/__init__.pxd +0 -0
  22. {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/color.pxd +0 -0
  23. {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/color.py +0 -0
  24. {cykit-0.0.4 → cykit-0.0.6}/cykit/cylogger/spdlog_logger.cpp +0 -0
  25. {cykit-0.0.4 → cykit-0.0.6}/cykit/spsc_queue/__init__.pxd +0 -0
  26. {cykit-0.0.4 → cykit-0.0.6}/cykit/spsc_queue/__init__.py +0 -0
  27. {cykit-0.0.4 → cykit-0.0.6}/cykit/spsc_queue/spsc_queue.cpp +0 -0
  28. {cykit-0.0.4 → cykit-0.0.6}/cykit/spsc_queue/spsc_queue.pxd +0 -0
  29. {cykit-0.0.4 → cykit-0.0.6}/cykit/utils/__init__.py +0 -0
  30. {cykit-0.0.4 → cykit-0.0.6}/cykit/utils/compat.pxd +0 -0
  31. {cykit-0.0.4 → cykit-0.0.6}/cykit/utils/msgbridge/__init__.pxd +0 -0
  32. {cykit-0.0.4 → cykit-0.0.6}/cykit/utils/msgbridge/__init__.py +0 -0
  33. {cykit-0.0.4 → cykit-0.0.6}/cykit/utils/msgbridge/msgbridge.cpp +0 -0
  34. {cykit-0.0.4 → cykit-0.0.6}/cykit/utils/msgbridge/msgbridge.pxd +0 -0
  35. {cykit-0.0.4 → cykit-0.0.6}/cykit/utils/msgbridge/msgbridge.pyx +0 -0
  36. {cykit-0.0.4 → cykit-0.0.6}/cykit.egg-info/SOURCES.txt +0 -0
  37. {cykit-0.0.4 → cykit-0.0.6}/cykit.egg-info/dependency_links.txt +0 -0
  38. {cykit-0.0.4 → cykit-0.0.6}/cykit.egg-info/not-zip-safe +0 -0
  39. {cykit-0.0.4 → cykit-0.0.6}/cykit.egg-info/top_level.txt +0 -0
  40. {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.4
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
  [![MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/Tapanhaz/cykit/blob/main/LICENSE-MIT)
31
31
  [![Apache License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/Tapanhaz/cykit/blob/main/LICENSE-APACHE)
32
32
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
33
+ [![Downloads](https://pepy.tech/badge/cykit)](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 Apache 2.0 licenses. See the LICENSE file for details.
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
  [![MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/Tapanhaz/cykit/blob/main/LICENSE-MIT)
7
7
  [![Apache License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/Tapanhaz/cykit/blob/main/LICENSE-APACHE)
8
8
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
9
+ [![Downloads](https://pepy.tech/badge/cykit)](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 Apache 2.0 licenses. See the LICENSE file for details.
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.
@@ -9,6 +9,7 @@ from cykit.cylogger.cylogger import (
9
9
  FileHandler,
10
10
  RotatingFileHandler,
11
11
  ColorScheme,
12
+ Level
12
13
  )
13
14
 
14
15
 
@@ -23,6 +24,7 @@ __all__ = [
23
24
  FileHandler,
24
25
  RotatingFileHandler,
25
26
  ColorScheme,
27
+ Level
26
28
  ]
27
29
 
28
30
 
@@ -1,36 +1,36 @@
1
1
  from typing import Optional, Literal, List
2
+ from enum import IntEnum
2
3
 
3
- Level = Literal[
4
- "trace",
5
- "debug",
6
- "info",
7
- "warn",
8
- "error",
9
- "critical",
10
- "off",
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: str
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: str = "trace",
22
+ level: Level = Level.TRACE,
23
23
  ) -> None: ...
24
24
 
25
25
  class StdoutHandler(LogHandler):
26
- max_level: str
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: str = "trace",
33
- max_level: str = "info",
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: str = "warn",
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: str = "trace",
49
+ level: Level = Level.TRACE,
50
50
  ) -> None: ...
51
51
 
52
52
  class ConsoleHandler(LogHandler):
53
- max_stdout_level: str
54
- min_level: str
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: str = "info",
61
- min_level: str = "trace",
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: str = "trace",
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: str = "trace",
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 = "trace",
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,