GrdUtil 1.9.2__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.
- grdutil-1.9.2/.gitattributes +2 -0
- grdutil-1.9.2/.github/workflows/publish.yml +60 -0
- grdutil-1.9.2/.gitignore +125 -0
- grdutil-1.9.2/GrdUtil.egg-info/PKG-INFO +58 -0
- grdutil-1.9.2/GrdUtil.egg-info/SOURCES.txt +53 -0
- grdutil-1.9.2/GrdUtil.egg-info/dependency_links.txt +1 -0
- grdutil-1.9.2/GrdUtil.egg-info/requires.txt +4 -0
- grdutil-1.9.2/GrdUtil.egg-info/top_level.txt +1 -0
- grdutil-1.9.2/LICENSE +21 -0
- grdutil-1.9.2/PKG-INFO +58 -0
- grdutil-1.9.2/README.md +41 -0
- grdutil-1.9.2/grdException/AddException.py +2 -0
- grdutil-1.9.2/grdException/ArgumentException.py +2 -0
- grdutil-1.9.2/grdException/BreakLoopException.py +2 -0
- grdutil-1.9.2/grdException/ContinueLoopException.py +2 -0
- grdutil-1.9.2/grdException/DatabaseException.py +2 -0
- grdutil-1.9.2/grdException/DeleteException.py +2 -0
- grdutil-1.9.2/grdException/DuplicateException.py +2 -0
- grdutil-1.9.2/grdException/ListException.py +2 -0
- grdutil-1.9.2/grdException/NotFoundException.py +2 -0
- grdutil-1.9.2/grdException/NotImplementedException.py +2 -0
- grdutil-1.9.2/grdException/ReadException.py +2 -0
- grdutil-1.9.2/grdException/ReadFileException.py +2 -0
- grdutil-1.9.2/grdException/TransactionException.py +2 -0
- grdutil-1.9.2/grdException/UnexpectedValuesException.py +2 -0
- grdutil-1.9.2/grdException/UpdateException.py +2 -0
- grdutil-1.9.2/grdException/UserException.py +2 -0
- grdutil-1.9.2/grdException/WriteFileException.py +2 -0
- grdutil-1.9.2/grdService/BaseEntity.py +30 -0
- grdutil-1.9.2/grdService/BaseService.py +265 -0
- grdutil-1.9.2/grdUtil/BashColor.py +41 -0
- grdutil-1.9.2/grdUtil/DateTimeObject.py +75 -0
- grdutil-1.9.2/grdUtil/DateTimeUtil.py +72 -0
- grdutil-1.9.2/grdUtil/DocUtil.py +103 -0
- grdutil-1.9.2/grdUtil/FilePathObject.py +155 -0
- grdutil-1.9.2/grdUtil/FileUtil.py +39 -0
- grdutil-1.9.2/grdUtil/FlagValues.py +45 -0
- grdutil-1.9.2/grdUtil/HttpVerb.py +8 -0
- grdutil-1.9.2/grdUtil/InputUtil.py +318 -0
- grdutil-1.9.2/grdUtil/JsonUtil.py +120 -0
- grdutil-1.9.2/grdUtil/ListUtil.py +37 -0
- grdutil-1.9.2/grdUtil/LocalJsonRepository.py +177 -0
- grdutil-1.9.2/grdUtil/LogLevel.py +12 -0
- grdutil-1.9.2/grdUtil/LogObject.py +14 -0
- grdutil-1.9.2/grdUtil/LogUtil.py +204 -0
- grdutil-1.9.2/grdUtil/PrintUtil.py +326 -0
- grdutil-1.9.2/grdUtil/ShellType.py +6 -0
- grdutil-1.9.2/grdUtil/ShellUtil.py +21 -0
- grdutil-1.9.2/grdUtil/StaticUtil.py +5 -0
- grdutil-1.9.2/grdUtil/StrUtil.py +45 -0
- grdutil-1.9.2/grdUtil/WebUtil.py +43 -0
- grdutil-1.9.2/grdUtil/__init__.py +0 -0
- grdutil-1.9.2/pyproject.toml +26 -0
- grdutil-1.9.2/requirements.txt +4 -0
- grdutil-1.9.2/setup.cfg +4 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
id-token: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
name: Build GrdUtil ${{github.ref_name}}
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
outputs:
|
|
17
|
+
version: ${{steps.get_version.outputs.version}}
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v6
|
|
20
|
+
with:
|
|
21
|
+
fetch-depth: 0
|
|
22
|
+
persist-credentials: false
|
|
23
|
+
|
|
24
|
+
- name: Set up Python
|
|
25
|
+
uses: actions/setup-python@v6
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.x"
|
|
28
|
+
|
|
29
|
+
- name: Install build dependencies
|
|
30
|
+
run: python -m pip install --upgrade build setuptools_scm twine
|
|
31
|
+
|
|
32
|
+
- name: Build distributions
|
|
33
|
+
run: python -m build
|
|
34
|
+
|
|
35
|
+
- name: Upload artifact
|
|
36
|
+
uses: actions/upload-artifact@v4
|
|
37
|
+
with:
|
|
38
|
+
name: grdutil
|
|
39
|
+
path: dist/
|
|
40
|
+
|
|
41
|
+
- name: List built files
|
|
42
|
+
run: ls -la dist/
|
|
43
|
+
|
|
44
|
+
publish:
|
|
45
|
+
name: Publish to PyPI
|
|
46
|
+
needs: build
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
environment:
|
|
49
|
+
name: pypi
|
|
50
|
+
url: https://pypi.org/project/grdutil/
|
|
51
|
+
permissions:
|
|
52
|
+
id-token: write
|
|
53
|
+
steps:
|
|
54
|
+
- uses: actions/download-artifact@v4
|
|
55
|
+
with:
|
|
56
|
+
name: grdutil
|
|
57
|
+
path: dist/
|
|
58
|
+
|
|
59
|
+
- name: Publish to PyPI
|
|
60
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
grdutil-1.9.2/.gitignore
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
|
|
2
|
+
# User added
|
|
3
|
+
|
|
4
|
+
.vscode
|
|
5
|
+
|
|
6
|
+
# Byte-compiled / optimized / DLL files
|
|
7
|
+
__pycache__/
|
|
8
|
+
*.py[cod]
|
|
9
|
+
*$py.class
|
|
10
|
+
|
|
11
|
+
# C extensions
|
|
12
|
+
*.so
|
|
13
|
+
|
|
14
|
+
# Distribution / packaging
|
|
15
|
+
.Python
|
|
16
|
+
build/
|
|
17
|
+
develop-eggs/
|
|
18
|
+
dist/
|
|
19
|
+
downloads/
|
|
20
|
+
eggs/
|
|
21
|
+
.eggs/
|
|
22
|
+
lib/
|
|
23
|
+
lib64/
|
|
24
|
+
parts/
|
|
25
|
+
sdist/
|
|
26
|
+
var/
|
|
27
|
+
wheels/
|
|
28
|
+
*.egg-info/
|
|
29
|
+
.installed.cfg
|
|
30
|
+
*.egg
|
|
31
|
+
MANIFEST
|
|
32
|
+
|
|
33
|
+
# PyInstaller
|
|
34
|
+
# Usually these files are written by a python script from a template
|
|
35
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
36
|
+
*.manifest
|
|
37
|
+
*.spec
|
|
38
|
+
|
|
39
|
+
# Installer logs
|
|
40
|
+
pip-log.txt
|
|
41
|
+
pip-delete-this-directory.txt
|
|
42
|
+
|
|
43
|
+
# Unit test / coverage reports
|
|
44
|
+
htmlcov/
|
|
45
|
+
.tox/
|
|
46
|
+
.nox/
|
|
47
|
+
.coverage
|
|
48
|
+
.coverage.*
|
|
49
|
+
.cache
|
|
50
|
+
nosetests.xml
|
|
51
|
+
coverage.xml
|
|
52
|
+
*.cover
|
|
53
|
+
.hypothesis/
|
|
54
|
+
.pytest_cache/
|
|
55
|
+
|
|
56
|
+
# Translations
|
|
57
|
+
*.mo
|
|
58
|
+
*.pot
|
|
59
|
+
|
|
60
|
+
# Django stuff:
|
|
61
|
+
*.log
|
|
62
|
+
local_settings.py
|
|
63
|
+
db.sqlite3
|
|
64
|
+
|
|
65
|
+
# Flask stuff:
|
|
66
|
+
instance/
|
|
67
|
+
.webassets-cache
|
|
68
|
+
|
|
69
|
+
# Scrapy stuff:
|
|
70
|
+
.scrapy
|
|
71
|
+
|
|
72
|
+
# Sphinx documentation
|
|
73
|
+
docs/_build/
|
|
74
|
+
|
|
75
|
+
# PyBuilder
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
.python-version
|
|
87
|
+
|
|
88
|
+
# celery beat schedule file
|
|
89
|
+
celerybeat-schedule
|
|
90
|
+
|
|
91
|
+
# SageMath parsed files
|
|
92
|
+
*.sage.py
|
|
93
|
+
|
|
94
|
+
# Environments
|
|
95
|
+
.env
|
|
96
|
+
.venv
|
|
97
|
+
env/
|
|
98
|
+
venv/
|
|
99
|
+
ENV/
|
|
100
|
+
env.bak/
|
|
101
|
+
venv.bak/
|
|
102
|
+
|
|
103
|
+
# Spyder project settings
|
|
104
|
+
.spyderproject
|
|
105
|
+
.spyproject
|
|
106
|
+
|
|
107
|
+
# Rope project settings
|
|
108
|
+
.ropeproject
|
|
109
|
+
|
|
110
|
+
# mkdocs documentation
|
|
111
|
+
/site
|
|
112
|
+
|
|
113
|
+
# mypy
|
|
114
|
+
.mypy_cache/
|
|
115
|
+
.dmypy.json
|
|
116
|
+
dmypy.json
|
|
117
|
+
|
|
118
|
+
# Pyre type checker
|
|
119
|
+
.pyre/
|
|
120
|
+
|
|
121
|
+
# Custom
|
|
122
|
+
*/Main.py
|
|
123
|
+
**test
|
|
124
|
+
**/test*
|
|
125
|
+
Main.py
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: GrdUtil
|
|
3
|
+
Version: 1.9.2
|
|
4
|
+
Summary: Various Python utility methods, printing, input handling, colouring text in Bash, and more
|
|
5
|
+
Author: Gardehal
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://pypi.org/project/grdutil
|
|
8
|
+
Project-URL: Repository, https://github.com/gardehal/python-packages
|
|
9
|
+
Requires-Python: >=3.8
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: furl==2.1.3
|
|
13
|
+
Requires-Dist: Requests==2.32.5
|
|
14
|
+
Requires-Dist: setuptools==75.6.0
|
|
15
|
+
Requires-Dist: validators==0.34.0
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
|
|
18
|
+
# python-packages / GrdUtil
|
|
19
|
+
|
|
20
|
+
Collection of general Python functions.
|
|
21
|
+
|
|
22
|
+
[](https://github.com/gardehal/python-packages/actions/workflows/publish.yml)
|
|
23
|
+
[]()
|
|
24
|
+
[](https://github.com/gardehal/python-packages/blob/main/LICENSE)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## Install locally
|
|
28
|
+
|
|
29
|
+
[PyPi project](https://pypi.org/project/grdutil/)
|
|
30
|
+
|
|
31
|
+
Install using pip
|
|
32
|
+
- $ `pip install grdutil`
|
|
33
|
+
- In python files: `from GrdUtil import *`
|
|
34
|
+
|
|
35
|
+
Install from files locally
|
|
36
|
+
- $ `cd [path to this folder]`
|
|
37
|
+
- $ `pip cache purge` (may help if old packages are cached)
|
|
38
|
+
- $ `pip install .`
|
|
39
|
+
|
|
40
|
+
## Errors
|
|
41
|
+
|
|
42
|
+
- Colours not showing in printX functions, getting "←[92m" or similar codes at start of lines
|
|
43
|
+
- Make sure you're using a shell that can render colours, like Git Bash
|
|
44
|
+
- Enter $ `export FORCE_COLOR=true` in the shell and close, then open the shell
|
|
45
|
+
|
|
46
|
+
## TODO
|
|
47
|
+
|
|
48
|
+
- fix init of FPO if file doesnt exist but path is valid
|
|
49
|
+
- fix pylance not recognizing this, temp fix by adding project to ctrl+, then extrapaths
|
|
50
|
+
- respect max width of terminal window
|
|
51
|
+
- asTable should have an option to not use labels, data as columns, not rows - use lists issue?
|
|
52
|
+
- logutil, missing JSON logging
|
|
53
|
+
- do something so colors show in MS cmd, powershell, etc.
|
|
54
|
+
- import, cannot use relative path like "..grdUtil.x" in grdService, or "..grdException.x" anywhere. Options? Always have to use self package?
|
|
55
|
+
- BaseService.baseRepository should be generic repo type, not locked to LocalJson, and be injectable
|
|
56
|
+
- delete WebUtil?
|
|
57
|
+
- convert DatetimeObject, FilePathObject to util functions
|
|
58
|
+
- json datetimes defaults to string, could be fixed? - seems not, despite hinting like "created: datetime", if the data is null, the type() is always NoneType. Alterative1: Can hack with using a default method on every model, but its slow and unreliable. Alternative2: wrap all datetimes and default-to-string values in object like { pythonType: "datetime", value: "2022-..." }. Requires a lot of refactoring from current...
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
.gitattributes
|
|
2
|
+
.gitignore
|
|
3
|
+
LICENSE
|
|
4
|
+
README.md
|
|
5
|
+
pyproject.toml
|
|
6
|
+
requirements.txt
|
|
7
|
+
.github/workflows/publish.yml
|
|
8
|
+
GrdUtil.egg-info/PKG-INFO
|
|
9
|
+
GrdUtil.egg-info/SOURCES.txt
|
|
10
|
+
GrdUtil.egg-info/dependency_links.txt
|
|
11
|
+
GrdUtil.egg-info/requires.txt
|
|
12
|
+
GrdUtil.egg-info/top_level.txt
|
|
13
|
+
grdException/AddException.py
|
|
14
|
+
grdException/ArgumentException.py
|
|
15
|
+
grdException/BreakLoopException.py
|
|
16
|
+
grdException/ContinueLoopException.py
|
|
17
|
+
grdException/DatabaseException.py
|
|
18
|
+
grdException/DeleteException.py
|
|
19
|
+
grdException/DuplicateException.py
|
|
20
|
+
grdException/ListException.py
|
|
21
|
+
grdException/NotFoundException.py
|
|
22
|
+
grdException/NotImplementedException.py
|
|
23
|
+
grdException/ReadException.py
|
|
24
|
+
grdException/ReadFileException.py
|
|
25
|
+
grdException/TransactionException.py
|
|
26
|
+
grdException/UnexpectedValuesException.py
|
|
27
|
+
grdException/UpdateException.py
|
|
28
|
+
grdException/UserException.py
|
|
29
|
+
grdException/WriteFileException.py
|
|
30
|
+
grdService/BaseEntity.py
|
|
31
|
+
grdService/BaseService.py
|
|
32
|
+
grdUtil/BashColor.py
|
|
33
|
+
grdUtil/DateTimeObject.py
|
|
34
|
+
grdUtil/DateTimeUtil.py
|
|
35
|
+
grdUtil/DocUtil.py
|
|
36
|
+
grdUtil/FilePathObject.py
|
|
37
|
+
grdUtil/FileUtil.py
|
|
38
|
+
grdUtil/FlagValues.py
|
|
39
|
+
grdUtil/HttpVerb.py
|
|
40
|
+
grdUtil/InputUtil.py
|
|
41
|
+
grdUtil/JsonUtil.py
|
|
42
|
+
grdUtil/ListUtil.py
|
|
43
|
+
grdUtil/LocalJsonRepository.py
|
|
44
|
+
grdUtil/LogLevel.py
|
|
45
|
+
grdUtil/LogObject.py
|
|
46
|
+
grdUtil/LogUtil.py
|
|
47
|
+
grdUtil/PrintUtil.py
|
|
48
|
+
grdUtil/ShellType.py
|
|
49
|
+
grdUtil/ShellUtil.py
|
|
50
|
+
grdUtil/StaticUtil.py
|
|
51
|
+
grdUtil/StrUtil.py
|
|
52
|
+
grdUtil/WebUtil.py
|
|
53
|
+
grdUtil/__init__.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
grdutil-1.9.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021-2026 Gardehal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
grdutil-1.9.2/PKG-INFO
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: GrdUtil
|
|
3
|
+
Version: 1.9.2
|
|
4
|
+
Summary: Various Python utility methods, printing, input handling, colouring text in Bash, and more
|
|
5
|
+
Author: Gardehal
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://pypi.org/project/grdutil
|
|
8
|
+
Project-URL: Repository, https://github.com/gardehal/python-packages
|
|
9
|
+
Requires-Python: >=3.8
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: furl==2.1.3
|
|
13
|
+
Requires-Dist: Requests==2.32.5
|
|
14
|
+
Requires-Dist: setuptools==75.6.0
|
|
15
|
+
Requires-Dist: validators==0.34.0
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
|
|
18
|
+
# python-packages / GrdUtil
|
|
19
|
+
|
|
20
|
+
Collection of general Python functions.
|
|
21
|
+
|
|
22
|
+
[](https://github.com/gardehal/python-packages/actions/workflows/publish.yml)
|
|
23
|
+
[]()
|
|
24
|
+
[](https://github.com/gardehal/python-packages/blob/main/LICENSE)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## Install locally
|
|
28
|
+
|
|
29
|
+
[PyPi project](https://pypi.org/project/grdutil/)
|
|
30
|
+
|
|
31
|
+
Install using pip
|
|
32
|
+
- $ `pip install grdutil`
|
|
33
|
+
- In python files: `from GrdUtil import *`
|
|
34
|
+
|
|
35
|
+
Install from files locally
|
|
36
|
+
- $ `cd [path to this folder]`
|
|
37
|
+
- $ `pip cache purge` (may help if old packages are cached)
|
|
38
|
+
- $ `pip install .`
|
|
39
|
+
|
|
40
|
+
## Errors
|
|
41
|
+
|
|
42
|
+
- Colours not showing in printX functions, getting "←[92m" or similar codes at start of lines
|
|
43
|
+
- Make sure you're using a shell that can render colours, like Git Bash
|
|
44
|
+
- Enter $ `export FORCE_COLOR=true` in the shell and close, then open the shell
|
|
45
|
+
|
|
46
|
+
## TODO
|
|
47
|
+
|
|
48
|
+
- fix init of FPO if file doesnt exist but path is valid
|
|
49
|
+
- fix pylance not recognizing this, temp fix by adding project to ctrl+, then extrapaths
|
|
50
|
+
- respect max width of terminal window
|
|
51
|
+
- asTable should have an option to not use labels, data as columns, not rows - use lists issue?
|
|
52
|
+
- logutil, missing JSON logging
|
|
53
|
+
- do something so colors show in MS cmd, powershell, etc.
|
|
54
|
+
- import, cannot use relative path like "..grdUtil.x" in grdService, or "..grdException.x" anywhere. Options? Always have to use self package?
|
|
55
|
+
- BaseService.baseRepository should be generic repo type, not locked to LocalJson, and be injectable
|
|
56
|
+
- delete WebUtil?
|
|
57
|
+
- convert DatetimeObject, FilePathObject to util functions
|
|
58
|
+
- json datetimes defaults to string, could be fixed? - seems not, despite hinting like "created: datetime", if the data is null, the type() is always NoneType. Alterative1: Can hack with using a default method on every model, but its slow and unreliable. Alternative2: wrap all datetimes and default-to-string values in object like { pythonType: "datetime", value: "2022-..." }. Requires a lot of refactoring from current...
|
grdutil-1.9.2/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# python-packages / GrdUtil
|
|
2
|
+
|
|
3
|
+
Collection of general Python functions.
|
|
4
|
+
|
|
5
|
+
[](https://github.com/gardehal/python-packages/actions/workflows/publish.yml)
|
|
6
|
+
[]()
|
|
7
|
+
[](https://github.com/gardehal/python-packages/blob/main/LICENSE)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## Install locally
|
|
11
|
+
|
|
12
|
+
[PyPi project](https://pypi.org/project/grdutil/)
|
|
13
|
+
|
|
14
|
+
Install using pip
|
|
15
|
+
- $ `pip install grdutil`
|
|
16
|
+
- In python files: `from GrdUtil import *`
|
|
17
|
+
|
|
18
|
+
Install from files locally
|
|
19
|
+
- $ `cd [path to this folder]`
|
|
20
|
+
- $ `pip cache purge` (may help if old packages are cached)
|
|
21
|
+
- $ `pip install .`
|
|
22
|
+
|
|
23
|
+
## Errors
|
|
24
|
+
|
|
25
|
+
- Colours not showing in printX functions, getting "←[92m" or similar codes at start of lines
|
|
26
|
+
- Make sure you're using a shell that can render colours, like Git Bash
|
|
27
|
+
- Enter $ `export FORCE_COLOR=true` in the shell and close, then open the shell
|
|
28
|
+
|
|
29
|
+
## TODO
|
|
30
|
+
|
|
31
|
+
- fix init of FPO if file doesnt exist but path is valid
|
|
32
|
+
- fix pylance not recognizing this, temp fix by adding project to ctrl+, then extrapaths
|
|
33
|
+
- respect max width of terminal window
|
|
34
|
+
- asTable should have an option to not use labels, data as columns, not rows - use lists issue?
|
|
35
|
+
- logutil, missing JSON logging
|
|
36
|
+
- do something so colors show in MS cmd, powershell, etc.
|
|
37
|
+
- import, cannot use relative path like "..grdUtil.x" in grdService, or "..grdException.x" anywhere. Options? Always have to use self package?
|
|
38
|
+
- BaseService.baseRepository should be generic repo type, not locked to LocalJson, and be injectable
|
|
39
|
+
- delete WebUtil?
|
|
40
|
+
- convert DatetimeObject, FilePathObject to util functions
|
|
41
|
+
- json datetimes defaults to string, could be fixed? - seems not, despite hinting like "created: datetime", if the data is null, the type() is always NoneType. Alterative1: Can hack with using a default method on every model, but its slow and unreliable. Alternative2: wrap all datetimes and default-to-string values in object like { pythonType: "datetime", value: "2022-..." }. Requires a lot of refactoring from current...
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import uuid
|
|
2
|
+
from datetime import datetime
|
|
3
|
+
|
|
4
|
+
from grdUtil.DateTimeUtil import getDateTime
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class BaseEntity():
|
|
8
|
+
def __init__(self,
|
|
9
|
+
created: datetime = getDateTime(),
|
|
10
|
+
updated: datetime = getDateTime(),
|
|
11
|
+
deleted: datetime = None,
|
|
12
|
+
id: str = str(uuid.uuid4())):
|
|
13
|
+
self.created: datetime = created
|
|
14
|
+
self.updated: datetime = updated
|
|
15
|
+
self.deleted: datetime = deleted
|
|
16
|
+
self.id: str = id
|
|
17
|
+
|
|
18
|
+
def summaryString(self):
|
|
19
|
+
return "".join(map(str, ["ID: ", self.id]))
|
|
20
|
+
|
|
21
|
+
def detailsString(self, includeId: bool = True, includeDatetime: bool = True, includeList: bool = True):
|
|
22
|
+
idString = ", id: " + self.id if(includeId) else ""
|
|
23
|
+
createdString = ", created: " + self.created if(includeDatetime) else ""
|
|
24
|
+
updatedString = ", updated: " + self.updated if(includeDatetime) else ""
|
|
25
|
+
deletedString = ", deleted: " + self.deleted if(includeDatetime) else ""
|
|
26
|
+
|
|
27
|
+
return "".join(map(str, [createdString,
|
|
28
|
+
updatedString,
|
|
29
|
+
deletedString,
|
|
30
|
+
idString]))
|