MapleX 2.2.0.dev2__tar.gz → 3.0.0.dev2__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 (32) hide show
  1. {maplex-2.2.0.dev2 → maplex-3.0.0.dev2}/LICENSE +1 -1
  2. {maplex-2.2.0.dev2 → maplex-3.0.0.dev2}/MANIFEST.in +3 -0
  3. maplex-3.0.0.dev2/PKG-INFO +197 -0
  4. maplex-3.0.0.dev2/README.md +175 -0
  5. maplex-3.0.0.dev2/logErrorOutputSample.png +0 -0
  6. maplex-3.0.0.dev2/logOutputSample.png +0 -0
  7. {maplex-2.2.0.dev2 → maplex-3.0.0.dev2}/pyproject.toml +8 -5
  8. maplex-3.0.0.dev2/readmes/LoggingTips.md +1 -0
  9. maplex-3.0.0.dev2/readmes/README_ConsoleColors.md +50 -0
  10. maplex-3.0.0.dev2/readmes/README_Exceptions.md +57 -0
  11. maplex-3.0.0.dev2/readmes/README_Json.md +10 -0
  12. maplex-3.0.0.dev2/readmes/README_Logger.md +115 -0
  13. maplex-2.2.0.dev2/README.md → maplex-3.0.0.dev2/readmes/README_MapleTree.md +275 -170
  14. maplex-3.0.0.dev2/src/MapleX.egg-info/PKG-INFO +197 -0
  15. {maplex-2.2.0.dev2 → maplex-3.0.0.dev2}/src/MapleX.egg-info/SOURCES.txt +13 -1
  16. {maplex-2.2.0.dev2 → maplex-3.0.0.dev2}/src/maplex/__init__.py +11 -2
  17. {maplex-2.2.0.dev2 → maplex-3.0.0.dev2}/src/maplex/mapleColors.py +1 -0
  18. {maplex-2.2.0.dev2 → maplex-3.0.0.dev2}/src/maplex/mapleExceptions.py +35 -0
  19. maplex-3.0.0.dev2/src/maplex/mapleJson.py +162 -0
  20. maplex-3.0.0.dev2/src/maplex/mapleLogger.py +764 -0
  21. {maplex-2.2.0.dev2 → maplex-3.0.0.dev2}/src/maplex/mapleTreeEditor.py +344 -27
  22. maplex-3.0.0.dev2/tests/test_logger_unittest.py +76 -0
  23. maplex-3.0.0.dev2/tests/test_maplejson_unittest.py +49 -0
  24. maplex-3.0.0.dev2/tests/test_mapletree_unittest.py +442 -0
  25. maplex-2.2.0.dev2/PKG-INFO +0 -921
  26. maplex-2.2.0.dev2/src/MapleX.egg-info/PKG-INFO +0 -921
  27. maplex-2.2.0.dev2/src/maplex/mapleLogger.py +0 -399
  28. {maplex-2.2.0.dev2 → maplex-3.0.0.dev2}/setup.cfg +0 -0
  29. {maplex-2.2.0.dev2 → maplex-3.0.0.dev2}/src/MapleX.egg-info/dependency_links.txt +0 -0
  30. {maplex-2.2.0.dev2 → maplex-3.0.0.dev2}/src/MapleX.egg-info/requires.txt +0 -0
  31. {maplex-2.2.0.dev2 → maplex-3.0.0.dev2}/src/MapleX.egg-info/top_level.txt +0 -0
  32. {maplex-2.2.0.dev2 → maplex-3.0.0.dev2}/src/maplex/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Ryuji Hazama
3
+ Copyright (c) 2026 Ryuji Hazama
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,9 @@
1
1
  include LICENSE
2
2
  include README.md
3
+ include readmes/*.md
3
4
  include release/*
5
+ include *.png
6
+ recursive-include tests *.py
4
7
 
5
8
  exclude .gitignore
6
9
  exclude mapleOutputTest.py
@@ -0,0 +1,197 @@
1
+ Metadata-Version: 2.4
2
+ Name: MapleX
3
+ Version: 3.0.0.dev2
4
+ Summary: A Python library for simple logging, json file operations, Maple file format operations, and console color utilities.
5
+ Author: RyujiHazama
6
+ Project-URL: PyPI, https://pypi.org/project/MapleX/
7
+ Project-URL: Homepage, https://github.com/Ryuji-Hazama
8
+ Project-URL: Repository, https://github.com/Ryuji-Hazama/MapleTree
9
+ Project-URL: Issues, https://github.com/Ryuji-Hazama/MapleTree/issues
10
+ Project-URL: YouTube, https://www.youtube.com/@ryujihazama
11
+ Project-URL: Instagram, https://www.instagram.com/ryujihazama/
12
+ Keywords: logging,logger,json,file operations,maple file format,console colors
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Requires-Python: >=3.12
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: cryptography>=46.0.3
20
+ Requires-Dist: pydantic>=2.12.5
21
+ Dynamic: license-file
22
+
23
+ # MapleX
24
+
25
+     MapleX is a Python library for simple logging, json file operations, Maple file format operations, and console color utilities.
26
+
27
+     ***You can install the package from pip with the following command.***
28
+
29
+ ```bash
30
+ pip install MapleX
31
+ ```
32
+
33
+ ## Logger Class
34
+
35
+     Logger is a logging object for Python applications. It outputs application logs to log files and to console (standard output).
36
+
37
+     Easy and simple enough to use, yet highly practical. The best logging library for beginners and for personal projects.
38
+
39
+ ### Beginner Friendly
40
+
41
+ #### Color Highlited Output
42
+
43
+     The output will be color-highlighted for better analysis based on the log level. (Not tested on macOS, and you need Windows Terminal for Windows OS)
44
+
45
+ ![Log output sample image](logOutputSample.png)
46
+
47
+ #### Outputs Stack Trace
48
+
49
+     You can use a function to outputs error message and the stack trace at once.
50
+
51
+ ![Stack Trace output sample image](logErrorOutputSample.png)
52
+
53
+ ### Logger Sample
54
+
55
+ ```python
56
+ import maplex
57
+
58
+ logger = maplex.getLogger("FunctionName")
59
+ logger.info("Hello there!")
60
+ ```
61
+
62
+ This outputs to console:
63
+
64
+ ```console
65
+ [INFO ][FunctionName] <module>(4) Hello there!
66
+ ```
67
+
68
+ Also outputs to the log file:
69
+
70
+ ```log
71
+ (PsNo) yyyy-MM-dd HH:mm:ss.fff [INFO ][FunctionName] <module>(4) Hello there!
72
+ ```
73
+
74
+ [More details](https://github.com/Ryuji-Hazama/MapleTree/blob/main/readmes/README_Logger.md)
75
+
76
+ [Logging Tips](https://github.com/Ryuji-Hazama/MapleTree/blob/main/readmes/LoggingTips.md)
77
+
78
+ ## MapleJson
79
+
80
+ &nbsp;&nbsp;&nbsp;&nbsp;MapleJson class is a library class for convert data between `dict` data and JSON formatted file data.
81
+
82
+ &nbsp;&nbsp;&nbsp;&nbsp;You can read, write and also encrypt a JSON file as a `dict` data.
83
+
84
+ [More details](https://github.com/Ryuji-Hazama/MapleTree/blob/main/readmes/README_Json.md)
85
+
86
+ ## Maple File Format
87
+
88
+ &nbsp;&nbsp;&nbsp;&nbsp;Maple is a file system that I created when I was a child. It's like a combination of the INI file and the Jason file. I made this format that is easy to read and write for both humans and machines.
89
+
90
+ ### Basic Format
91
+
92
+ ```text
93
+ All data before MAPLE\n will be ignored
94
+
95
+ MAPLE
96
+ # Maple data must start with "MAPLE"
97
+
98
+ *MAPLE_TIME
99
+ yyyy/MM/dd HH:mm:ss.fffffff
100
+ # Encoded time or optional time in the method parameter
101
+
102
+ H *STATUS
103
+ # File status
104
+ ADT yyyy/MM/dd HH:mm:ss.fffffff
105
+ RDT yyyy/MM/dd HH:mm:ss.fffffff
106
+ CNT {int}
107
+ H #*
108
+ ADT is the most recent edited time
109
+ RDT is the second most recent edited time (before ADT)
110
+ CNT is the data count (Optional)
111
+ E *#
112
+ E
113
+ H *Header
114
+ # Headers include '*' are system headers
115
+ E
116
+ H Data Headers
117
+ H Sub Data Header
118
+ CMT Comments
119
+ # This is also a comment
120
+ Tags Properties
121
+ # Propaties cannot include 'CRLF.'
122
+ Tags2 Properties
123
+ # You cannot use the same tags in a Header except CMT and NTE in H NOTES
124
+ H Sub Data Header
125
+ Tags Propaties
126
+ # You can use the same tag in the child header,
127
+ # which is already used in the parents' header
128
+ E
129
+ E
130
+ H *NOTES NOTES_HEADER
131
+ # Note's header
132
+ NTE {strimg}
133
+ NTE ...
134
+ # Notes' main strings for the multi-line data
135
+ # COMMENTS IN THE "*NOTES" BLOCK WILL BE DELETED WHEN SAVING!
136
+ E
137
+ H #*
138
+ This is a comment block.
139
+ Starts with "H #*"
140
+ and ends with "E *#"
141
+ E *#
142
+ E
143
+ H Data Headers2
144
+ E
145
+ # "\nEOF\n" must be needed for all data
146
+ EOF
147
+
148
+ All datas after "\nEOF\n" will be ignored
149
+ ```
150
+
151
+ [More details](https://github.com/Ryuji-Hazama/MapleTree/blob/main/readmes/README_MapleTree.md#maple-file)
152
+
153
+ ## MapleTree Class
154
+
155
+ &nbsp;&nbsp;&nbsp;&nbsp;MapleTree class is a Python library for read, edit, and write the Maple formatted file from the Python code.
156
+ &nbsp;&nbsp;&nbsp;&nbsp;You can also automatically encrypt the file data using the library functions.
157
+
158
+ [More details](https://github.com/Ryuji-Hazama/MapleTree/blob/main/readmes/README_MapleTree.md#mapletree-class)
159
+
160
+ ## Exceptions
161
+
162
+ &nbsp;&nbsp;&nbsp;&nbsp;Excption classes are the specialized classes for MapleX to make your debug easier.
163
+
164
+ [More details](https://github.com/Ryuji-Hazama/MapleTree/blob/main/readmes/README_Exceptions.md#exceptions)
165
+
166
+ ## Console Colors
167
+
168
+ &nbsp;&nbsp;&nbsp;&nbsp;ConsoleColors class is a class library for color-highlight the standard output.
169
+
170
+ [More details](https://github.com/Ryuji-Hazama/MapleTree/blob/main/readmes/README_ConsoleColors.md)
171
+
172
+ ## Install MapleX
173
+
174
+ ### From PyPI
175
+
176
+ ```bash
177
+ [python[3] -m] pip install MapleX [--break-system-packages]
178
+ ```
179
+
180
+ ### Manual Installation
181
+
182
+ 1. Download `./dist/maplex-<version>-py3-none-any.whl`
183
+ 2. Run `[python[3] -m] pip install /path/to/downloaded/maplex-<version>-py3-none-any.whl [--break-system-packages]`
184
+
185
+ ### Build the Package by Yourself
186
+
187
+ &nbsp;&nbsp;&nbsp;&nbsp;Run `python[3] -m build`
188
+
189
+ or
190
+
191
+ &nbsp;&nbsp;&nbsp;&nbsp;Run `python[3] setup.py sdist bdist_wheel`
192
+
193
+ ### Unit test
194
+
195
+ ```bash
196
+ python[3] -m unittest discover -s tests
197
+ ```
@@ -0,0 +1,175 @@
1
+ # MapleX
2
+
3
+ &nbsp;&nbsp;&nbsp;&nbsp;MapleX is a Python library for simple logging, json file operations, Maple file format operations, and console color utilities.
4
+
5
+ &nbsp;&nbsp;&nbsp;&nbsp;***You can install the package from pip with the following command.***
6
+
7
+ ```bash
8
+ pip install MapleX
9
+ ```
10
+
11
+ ## Logger Class
12
+
13
+ &nbsp;&nbsp;&nbsp;&nbsp;Logger is a logging object for Python applications. It outputs application logs to log files and to console (standard output).
14
+
15
+ &nbsp;&nbsp;&nbsp;&nbsp;Easy and simple enough to use, yet highly practical. The best logging library for beginners and for personal projects.
16
+
17
+ ### Beginner Friendly
18
+
19
+ #### Color Highlited Output
20
+
21
+ &nbsp;&nbsp;&nbsp;&nbsp;The output will be color-highlighted for better analysis based on the log level. (Not tested on macOS, and you need Windows Terminal for Windows OS)
22
+
23
+ ![Log output sample image](logOutputSample.png)
24
+
25
+ #### Outputs Stack Trace
26
+
27
+ &nbsp;&nbsp;&nbsp;&nbsp;You can use a function to outputs error message and the stack trace at once.
28
+
29
+ ![Stack Trace output sample image](logErrorOutputSample.png)
30
+
31
+ ### Logger Sample
32
+
33
+ ```python
34
+ import maplex
35
+
36
+ logger = maplex.getLogger("FunctionName")
37
+ logger.info("Hello there!")
38
+ ```
39
+
40
+ This outputs to console:
41
+
42
+ ```console
43
+ [INFO ][FunctionName] <module>(4) Hello there!
44
+ ```
45
+
46
+ Also outputs to the log file:
47
+
48
+ ```log
49
+ (PsNo) yyyy-MM-dd HH:mm:ss.fff [INFO ][FunctionName] <module>(4) Hello there!
50
+ ```
51
+
52
+ [More details](https://github.com/Ryuji-Hazama/MapleTree/blob/main/readmes/README_Logger.md)
53
+
54
+ [Logging Tips](https://github.com/Ryuji-Hazama/MapleTree/blob/main/readmes/LoggingTips.md)
55
+
56
+ ## MapleJson
57
+
58
+ &nbsp;&nbsp;&nbsp;&nbsp;MapleJson class is a library class for convert data between `dict` data and JSON formatted file data.
59
+
60
+ &nbsp;&nbsp;&nbsp;&nbsp;You can read, write and also encrypt a JSON file as a `dict` data.
61
+
62
+ [More details](https://github.com/Ryuji-Hazama/MapleTree/blob/main/readmes/README_Json.md)
63
+
64
+ ## Maple File Format
65
+
66
+ &nbsp;&nbsp;&nbsp;&nbsp;Maple is a file system that I created when I was a child. It's like a combination of the INI file and the Jason file. I made this format that is easy to read and write for both humans and machines.
67
+
68
+ ### Basic Format
69
+
70
+ ```text
71
+ All data before MAPLE\n will be ignored
72
+
73
+ MAPLE
74
+ # Maple data must start with "MAPLE"
75
+
76
+ *MAPLE_TIME
77
+ yyyy/MM/dd HH:mm:ss.fffffff
78
+ # Encoded time or optional time in the method parameter
79
+
80
+ H *STATUS
81
+ # File status
82
+ ADT yyyy/MM/dd HH:mm:ss.fffffff
83
+ RDT yyyy/MM/dd HH:mm:ss.fffffff
84
+ CNT {int}
85
+ H #*
86
+ ADT is the most recent edited time
87
+ RDT is the second most recent edited time (before ADT)
88
+ CNT is the data count (Optional)
89
+ E *#
90
+ E
91
+ H *Header
92
+ # Headers include '*' are system headers
93
+ E
94
+ H Data Headers
95
+ H Sub Data Header
96
+ CMT Comments
97
+ # This is also a comment
98
+ Tags Properties
99
+ # Propaties cannot include 'CRLF.'
100
+ Tags2 Properties
101
+ # You cannot use the same tags in a Header except CMT and NTE in H NOTES
102
+ H Sub Data Header
103
+ Tags Propaties
104
+ # You can use the same tag in the child header,
105
+ # which is already used in the parents' header
106
+ E
107
+ E
108
+ H *NOTES NOTES_HEADER
109
+ # Note's header
110
+ NTE {strimg}
111
+ NTE ...
112
+ # Notes' main strings for the multi-line data
113
+ # COMMENTS IN THE "*NOTES" BLOCK WILL BE DELETED WHEN SAVING!
114
+ E
115
+ H #*
116
+ This is a comment block.
117
+ Starts with "H #*"
118
+ and ends with "E *#"
119
+ E *#
120
+ E
121
+ H Data Headers2
122
+ E
123
+ # "\nEOF\n" must be needed for all data
124
+ EOF
125
+
126
+ All datas after "\nEOF\n" will be ignored
127
+ ```
128
+
129
+ [More details](https://github.com/Ryuji-Hazama/MapleTree/blob/main/readmes/README_MapleTree.md#maple-file)
130
+
131
+ ## MapleTree Class
132
+
133
+ &nbsp;&nbsp;&nbsp;&nbsp;MapleTree class is a Python library for read, edit, and write the Maple formatted file from the Python code.
134
+ &nbsp;&nbsp;&nbsp;&nbsp;You can also automatically encrypt the file data using the library functions.
135
+
136
+ [More details](https://github.com/Ryuji-Hazama/MapleTree/blob/main/readmes/README_MapleTree.md#mapletree-class)
137
+
138
+ ## Exceptions
139
+
140
+ &nbsp;&nbsp;&nbsp;&nbsp;Excption classes are the specialized classes for MapleX to make your debug easier.
141
+
142
+ [More details](https://github.com/Ryuji-Hazama/MapleTree/blob/main/readmes/README_Exceptions.md#exceptions)
143
+
144
+ ## Console Colors
145
+
146
+ &nbsp;&nbsp;&nbsp;&nbsp;ConsoleColors class is a class library for color-highlight the standard output.
147
+
148
+ [More details](https://github.com/Ryuji-Hazama/MapleTree/blob/main/readmes/README_ConsoleColors.md)
149
+
150
+ ## Install MapleX
151
+
152
+ ### From PyPI
153
+
154
+ ```bash
155
+ [python[3] -m] pip install MapleX [--break-system-packages]
156
+ ```
157
+
158
+ ### Manual Installation
159
+
160
+ 1. Download `./dist/maplex-<version>-py3-none-any.whl`
161
+ 2. Run `[python[3] -m] pip install /path/to/downloaded/maplex-<version>-py3-none-any.whl [--break-system-packages]`
162
+
163
+ ### Build the Package by Yourself
164
+
165
+ &nbsp;&nbsp;&nbsp;&nbsp;Run `python[3] -m build`
166
+
167
+ or
168
+
169
+ &nbsp;&nbsp;&nbsp;&nbsp;Run `python[3] setup.py sdist bdist_wheel`
170
+
171
+ ### Unit test
172
+
173
+ ```bash
174
+ python[3] -m unittest discover -s tests
175
+ ```
Binary file
@@ -4,14 +4,13 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "MapleX"
7
- version = "2.2.0.dev2"
8
- description = """
9
- MapleX: A Python library for Maple file format operations, with logging and console color utilities
10
- """
7
+ version = "3.0.0.dev2"
8
+ description = """A Python library for simple logging, json file operations, Maple file format operations, and console color utilities."""
9
+ keywords = ["logging", "logger", "json", "file operations", "maple file format", "console colors"]
11
10
  readme = "README.md"
12
11
  license-files = ["LICENSE"]
13
12
  authors = [
14
- {name = "Ryuji Hazama"}
13
+ {name = "RyujiHazama"}
15
14
  ]
16
15
  dependencies = [
17
16
  "cryptography>=46.0.3",
@@ -26,6 +25,10 @@ requires-python = ">=3.12"
26
25
 
27
26
  [tool.setuptools.packages.find]
28
27
  where = ["src"]
28
+ include = ["maplex*"]
29
+
30
+ [tool.setuptools.package-data]
31
+ "*" = ["tests/*.py"]
29
32
 
30
33
  [project.urls]
31
34
  PyPI = "https://pypi.org/project/MapleX/"
@@ -0,0 +1 @@
1
+ # Logging Tips
@@ -0,0 +1,50 @@
1
+ # Console Colors
2
+
3
+ ## Standard colors
4
+
5
+ |Key|Value|Color|
6
+ |---|-----|-----|
7
+ |`Black`|\\033\[30m|Black|
8
+ |`Red`|\\033\[31m|Red|
9
+ |`Green`|\\033\[32m|Green|
10
+ |`Yellow`|\\033\[33m|Yellow|
11
+ |`Blue`|\\033\[34m|Blue|
12
+ |`Magenta`|\\033\[35m|Magenta|
13
+ |`LightBlue`|\\033\[36m|LightBlue|
14
+ |`White`|\\033\[37m|White|
15
+
16
+ ## Bright colors
17
+
18
+ |Key|Value|Color|
19
+ |---|-----|-----|
20
+ |`bBlack`|\\033\[90m|Black|
21
+ |`bRed`|\\033\[91m|Red|
22
+ |`bGreen`|\\033\[92m|Green|
23
+ |`bYellow`|\\033\[93m|Yellow|
24
+ |`bBlue`|\\033\[94m|Blue|
25
+ |`bMagenta`|\\033\[95m|Magenta|
26
+ |`bLightBlue`|\\033\[96m|LightBlue|
27
+ |`bWhite`|\\033\[97m|White|
28
+
29
+ ## Background colors
30
+
31
+ |Key|Value|Color|
32
+ |---|-----|-----|
33
+ |`bgBlack`|\\033\[40m|Black|
34
+ |`bgRed`|\\033\[41m|Red|
35
+ |`bgGreen`|\\033\[42m|Green|
36
+ |`bgYellow`|\\033\[43m|Yellow|
37
+ |`bgBlue`|\\033\[44m|Blue|
38
+ |`bgMagenta`|\\033\[45m|Magenta|
39
+ |`bgLightBlue`|\\033\[46m|LightBlue|
40
+ |`bgWhite`|\\033\[47m|White|
41
+
42
+ ## Other formats
43
+
44
+ |Key|Value|Description|
45
+ |---|-----|-----------|
46
+ |`Bold`|\\033\[1m|Bold text|
47
+ |`Italic`|\\033\[3m|Italic text|
48
+ |`Underline`|\\033\[4m|Underlined text|
49
+ |`Reversed`|\\033\[7m|Reversed colors|
50
+ |`Reset`|\\033\[0m|Reset formatting|
@@ -0,0 +1,57 @@
1
+ # Exceptions
2
+
3
+ ## `class MapleException(Exception)`
4
+
5
+ &nbsp;&nbsp;&nbsp;&nbsp;This is a basic exception class for MapleTree.
6
+
7
+ ## `class MapleFileNotFoundException(MapleException)`
8
+
9
+ &nbsp;&nbsp;&nbsp;&nbsp;This occurs when the file that was specified at the instance initialization was not found.
10
+
11
+ ## `class KeyEmptyException(MapleException)`
12
+
13
+ &nbsp;&nbsp;&nbsp;&nbsp;This occurs when `encrypt=True` is used at the instance initialization, but the key for encryption is missing (`None` or empty).
14
+
15
+ ## `class MapleFileLockedException(MapleException)`
16
+
17
+ &nbsp;&nbsp;&nbsp;&nbsp;This occurs when the instance tries to open the file, but the other instance has already locked the file.
18
+
19
+ ## `class MapleDataNotFoundException(MapleException)`
20
+
21
+ &nbsp;&nbsp;&nbsp;&nbsp;This occurs when the data is not found in the file.
22
+
23
+ ## `MapleEncryptionNotEnabledException(MapleException)`
24
+
25
+ &nbsp;&nbsp;&nbsp;&nbsp;This occurs when trying to encrypt Maple data, but the encryption flag is `False`.
26
+
27
+ ## `class MapleHeaderNotFoundException(MapleDataNotFoundException)`
28
+
29
+ &nbsp;&nbsp;&nbsp;&nbsp;This occurs when the header (specified by the user) is not found in the data.
30
+
31
+ ## `class MapleTagNotFoundException(MapleDataNotFoundException)`
32
+
33
+ &nbsp;&nbsp;&nbsp;&nbsp;This occurs when the tag (specified by the user) is not found in the data.
34
+
35
+ ## `class NotAMapleFileException(MapleDataNotFoundException)`
36
+
37
+ &nbsp;&nbsp;&nbsp;&nbsp;This occurs when the file is not a Maple file.
38
+
39
+ - The file without a "MAPLE" line.
40
+
41
+ ## `class InvalidMapleFileFormatException(NotAMapleFileException)`
42
+
43
+ &nbsp;&nbsp;&nbsp;&nbsp;This occurs when the file format is an invalid Maple format.
44
+
45
+ - The file has a "MAPLE" line, but the format is wrong or broken.
46
+
47
+ ## `class MapleFileEmptyException(NotAMapleFileException)`
48
+
49
+ &nbsp;&nbsp;&nbsp;&nbsp;This occurs when the file is empty (No data)
50
+
51
+ ## `class MapleSyntaxException(MapleException)`
52
+
53
+ &nbsp;&nbsp;&nbsp;&nbsp;This occurs when the syntax of the MapleTree function (mostly its parameter) is invalid.
54
+
55
+ ## `class MapleTypeException(MapleSyntaxException)`
56
+
57
+ &nbsp;&nbsp;&nbsp;&nbsp;This occurs when the user hands the unknown keyword arguments as the `**kwargs` to the MapleTree function.
@@ -0,0 +1,10 @@
1
+ # MapleJson Class
2
+
3
+ &nbsp;&nbsp;&nbsp;&nbsp;MapleJson class is a class library to manage the JSON formatted files.
4
+
5
+ - You can read a JSON file as a `dict` data.
6
+ - You can write the `dict` data into a file as a JSON formatted string
7
+ - You can save the data as an encrypted data string.
8
+ - You can decrypt the encrypted data.
9
+
10
+ ## Class Initialization
@@ -0,0 +1,115 @@
1
+ # Logger Class
2
+
3
+ &nbsp;&nbsp;&nbsp;&nbsp;Logger class is a logging object for Python applications. It outputs application logs to log files and to standard output.
4
+
5
+ ## Logger Initialization
6
+
7
+ ```python
8
+ def __init__(
9
+ func: str = "",
10
+ workingDirectory: str | None = None,
11
+ cmdLogLevel: str | None = None,
12
+ fileLogLevel: str | None = None,
13
+ maxLogSize: float | None = None,
14
+ fileMode: Literal["append", "overwrite", "daily"] | None = None,
15
+ configFile: str = "config.json",
16
+ encoding: str | None = None,
17
+ ) -> None:
18
+ ```
19
+
20
+ |Property|Required|Value|Version|
21
+ |--------|--------|-----|-------|
22
+ |**`func`**||Primary function name||
23
+ |**`workingDirectory`**||Log file output directory||
24
+ |**`cmdLogLevel`**||Terminal output log level||
25
+ |**`fileLogLevel`**||Log file output log level||
26
+ |**`maxLogSize`**||Log file max size (MB)||
27
+ |**`fileMode`**||Logging file mode|`v3.0`|
28
+ |**`configFile`**||Logger configuration file path|`v3.0`|
29
+ |**`encoding`**||Log file encoding|`v3.0`|
30
+
31
+ &nbsp;&nbsp;&nbsp;&nbsp;The parameter overwrites the settings configured in `config.mpl`.
32
+
33
+ ## Usage
34
+
35
+ ```python
36
+ from maplex
37
+
38
+ logger = maplex.getLogger("FunctionName")
39
+ logger.info("Hello there!")
40
+ ```
41
+
42
+ This outputs:
43
+
44
+ ```console
45
+ [INFO ][FunctionName] <module>(4) Hello there!
46
+ ```
47
+
48
+ File output will be: `AppLog.log`
49
+
50
+ ```log
51
+ (PsNo) yyyy-MM-dd HH:mm:ss.fff [INFO ][FunctionName] <module>(4) Hello there!
52
+ ```
53
+
54
+ ### Log Level
55
+
56
+ - `TRACE`
57
+ - `DEBUG`
58
+ - `INFO`
59
+ - `WARN`
60
+ - `ERROR`
61
+ - `FATAL`
62
+
63
+ ### ShowError function
64
+
65
+ &nbsp;&nbsp;&nbsp;&nbsp;This outputs the error logs and stuck trace.
66
+
67
+ Function:
68
+
69
+ ```python
70
+ def ShowError(
71
+ ex: Exception,
72
+ message: str | None = None,
73
+ fatal: bool = False
74
+ )
75
+ ```
76
+
77
+ |Property|Required|Value|
78
+ |--------|--------|-----|
79
+ |**`ex`**|\*|Exception|
80
+ |**`message`**||Custom error message|
81
+ |**`fatal`**||Show error as `FATAL`|
82
+
83
+ - If `fatal=True`, it outputs log as a `FATAL` log level.
84
+
85
+ ## Settings
86
+
87
+ - You can configure log settings with a JSON formatted file (default: `config.json`).
88
+ - If the configuration file does not exist, the instance auto-generates the file.
89
+ - Instance uses the parameter values to auto-generate a configuration file, or uses the default value if it was not specified.
90
+
91
+ Auto-generated configuration file (parameters not specified):
92
+
93
+ ```json
94
+ {
95
+ "MapleLogger": {
96
+ "ConsoleLogLevel": "INFO",
97
+ "FileLogLevel": "INFO",
98
+ "MaxLogSize": 3.0,
99
+ "WorkingDirectory": "/path/to/output/logs",
100
+ "FileEncoding": "utf-8"
101
+ }
102
+ }
103
+ ```
104
+
105
+ |Key|Value|
106
+ |---|-----|
107
+ |**`ConsoleLogLevel`**|Console log level|
108
+ |**`FileLogLevel`**|File log level|
109
+ |**`MaxLogSize`**|Log file max size (MB)|
110
+ |**`WorkingDirectory`**|Log file output path|
111
+ |**`FileEncoding`**|Log file encoding|
112
+
113
+ - To disable the log output, set the log level to `NONE`.
114
+ - You can use a `float` number for the file max size (E.g., `2.5` for `2.5MB`)
115
+ - You can also use a `str` for the file max size (E.g., `"3M"`)