mirror of
https://github.com/dtomlinson91/panaetius.git
synced 2026-09-22 22:47:13 +00:00
chore: prepare release v2.3.5
This commit is contained in:
@@ -3,6 +3,12 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
<!-- marker -->
|
<!-- marker -->
|
||||||
|
## [v2.3.5](https://github.com/dtomlinson91/panaetius/commits/v2.3.5) - 2022-01-30
|
||||||
|
<small>[Compare with v2.3.4](https://github.com/dtomlinson91/panaetius/compare/v2.3.4...v2.3.5)</small>
|
||||||
|
|
||||||
|
### 🧱 Build
|
||||||
|
|
||||||
|
- Relax PyYAML version constraint for better compatibility ([a0583b5](https://github.com/dtomlinson91/panaetius/commit/a0583b5f0aa3068139827ff46f8a7aa16cd6b424))
|
||||||
## [v2.3.4](https://github.com/dtomlinson91/panaetius/commits/v2.3.4) - 2022-01-03
|
## [v2.3.4](https://github.com/dtomlinson91/panaetius/commits/v2.3.4) - 2022-01-03
|
||||||
<small>[Compare with 2.3.3](https://github.com/dtomlinson91/panaetius/compare/2.3.3...v2.3.4)</small>
|
<small>[Compare with 2.3.3](https://github.com/dtomlinson91/panaetius/compare/2.3.3...v2.3.4)</small>
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
"""Module containing the version of panaetius."""
|
"""Module containing the version of panaetius."""
|
||||||
|
|
||||||
__version__ = "2.3.4"
|
__version__ = "2.3.5"
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "panaetius"
|
name = "panaetius"
|
||||||
version = "2.3.4"
|
version = "2.3.5"
|
||||||
description = "Python module to gracefully handle a .config file/environment variables for scripts, with built in masking for sensitive options. Provides a Splunk friendly formatted logger instance."
|
description = "Python module to gracefully handle a .config file/environment variables for scripts, with built in masking for sensitive options. Provides a Splunk friendly formatted logger instance."
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
authors = ["dtomlinson <dtomlinson@panaetius.co.uk>"]
|
authors = ["dtomlinson <dtomlinson@panaetius.co.uk>"]
|
||||||
|
|||||||
@@ -1,2 +1 @@
|
|||||||
pyyaml==6.0; python_version >= "3.6"
|
pyyaml==6.0; python_version >= "3.6"
|
||||||
toml==0.10.2; (python_version >= "2.6" and python_full_version < "3.0.0") or (python_full_version >= "3.3.0")
|
|
||||||
|
|||||||
+33
-34
@@ -1,68 +1,67 @@
|
|||||||
ansimarkup==1.5.0; python_version >= "3.6"
|
ansimarkup==1.5.0; python_version >= "3.6"
|
||||||
astroid==2.9.1; python_full_version >= "3.6.2" and python_version < "4.0"
|
astroid==2.9.3; python_full_version >= "3.6.2" and python_version < "4.0"
|
||||||
atomicwrites==1.4.0; python_version >= "3.6" and python_full_version < "3.0.0" and sys_platform == "win32" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6") or sys_platform == "win32" and python_version >= "3.6" and python_full_version >= "3.4.0" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6")
|
atomicwrites==1.4.0; python_version >= "3.6" and python_full_version < "3.0.0" and sys_platform == "win32" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6") or sys_platform == "win32" and python_version >= "3.6" and python_full_version >= "3.4.0" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6")
|
||||||
attrs==21.4.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
attrs==21.4.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||||
bandit==1.7.1; python_full_version >= "3.6.1" and python_version < "4.0" and python_version >= "3.5"
|
bandit==1.7.2; python_full_version >= "3.6.2" and python_version < "4.0" and python_version >= "3.7"
|
||||||
cached-property==1.5.2; python_version < "3.8" and python_version >= "3.6"
|
cached-property==1.5.2; python_version < "3.8" and python_version >= "3.6"
|
||||||
certifi==2021.10.8; python_version >= "3.5" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.5"
|
certifi==2021.10.8; python_version >= "3.5" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.5"
|
||||||
charset-normalizer==2.0.9; python_full_version >= "3.6.0" and python_version >= "3.5"
|
charset-normalizer==2.0.10; python_full_version >= "3.6.0" and python_version >= "3.5"
|
||||||
click==8.0.3; python_version >= "3.6"
|
click==8.0.3; python_version >= "3.6"
|
||||||
colorama==0.4.4; sys_platform == "win32" and python_version >= "3.6" and python_full_version >= "3.6.2" and python_version < "4.0" and platform_system == "Windows" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6")
|
colorama==0.4.4; sys_platform == "win32" and python_version >= "3.7" and python_full_version >= "3.6.2" and python_version < "4.0" and platform_system == "Windows" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6")
|
||||||
coverage==6.2; python_version >= "3.6"
|
coverage==6.3; python_version >= "3.7"
|
||||||
dodgy==0.2.1; python_full_version >= "3.6.1" and python_version < "4.0"
|
dodgy==0.2.1; python_full_version >= "3.6.2" and python_version < "4.0"
|
||||||
dparse==0.5.1; python_version >= "3.5"
|
dparse==0.5.1; python_version >= "3.5"
|
||||||
duty==0.7.0; python_version >= "3.6"
|
duty==0.7.0; python_version >= "3.6"
|
||||||
execnet==1.9.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
execnet==1.9.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||||
failprint==0.8.0; python_version >= "3.6"
|
failprint==0.8.0; python_version >= "3.6"
|
||||||
flake8-polyfill==1.0.2; python_full_version >= "3.6.1" and python_version < "4.0"
|
flake8-polyfill==1.0.2; python_full_version >= "3.6.2" and python_version < "4.0"
|
||||||
flake8==2.3.0; python_full_version >= "3.6.1" and python_version < "4.0"
|
flake8==2.3.0; python_full_version >= "3.6.2" and python_version < "4.0"
|
||||||
gitdb==4.0.9; python_full_version >= "3.6.1" and python_version < "4.0" and python_version >= "3.7"
|
gitdb==4.0.9; python_full_version >= "3.6.2" and python_version < "4.0" and python_version >= "3.7"
|
||||||
gitpython==3.1.24; python_full_version >= "3.6.1" and python_version < "4.0" and python_version >= "3.7"
|
gitpython==3.1.26; python_full_version >= "3.6.2" and python_version < "4.0" and python_version >= "3.7"
|
||||||
idna==3.3; python_version >= "3.5" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.5"
|
idna==3.3; python_version >= "3.5" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.5"
|
||||||
importlib-metadata==4.10.0; python_version < "3.8" and python_version >= "3.7" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6") and python_full_version >= "3.6.1"
|
importlib-metadata==4.10.1; python_version < "3.8" and python_version >= "3.7" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6") and python_full_version >= "3.6.2"
|
||||||
iniconfig==1.1.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
|
iniconfig==1.1.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
|
||||||
isort==5.10.1; python_full_version >= "3.6.1" and python_version < "4.0"
|
isort==5.10.1; python_full_version >= "3.6.1" and python_version < "4.0"
|
||||||
jinja2==3.0.3; python_version >= "3.6"
|
jinja2==3.0.3; python_version >= "3.6"
|
||||||
lazy-object-proxy==1.7.1; python_full_version >= "3.6.2" and python_version < "4.0" and python_version >= "3.6"
|
lazy-object-proxy==1.7.1; python_full_version >= "3.6.2" and python_version < "4.0" and python_version >= "3.6"
|
||||||
markupsafe==2.0.1; python_version >= "3.6"
|
markupsafe==2.0.1; python_version >= "3.6"
|
||||||
mccabe==0.6.1; python_full_version >= "3.6.2" and python_version < "4.0"
|
mccabe==0.6.1; python_full_version >= "3.6.2" and python_version < "4.0"
|
||||||
mypy-extensions==0.4.3; python_full_version >= "3.6.1" and python_version < "4.0" and python_version >= "3.5"
|
mypy-extensions==0.4.3; python_full_version >= "3.6.2" and python_version < "4.0" and python_version >= "3.5"
|
||||||
mypy==0.910; python_version >= "3.5"
|
mypy==0.910; python_version >= "3.5"
|
||||||
packaging==21.3; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
|
packaging==21.3; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
|
||||||
pbr==5.8.0; python_full_version >= "3.6.1" and python_version < "4.0" and python_version >= "3.6"
|
pbr==5.8.0; python_full_version >= "3.6.2" and python_version < "4.0" and python_version >= "3.7"
|
||||||
pep8-naming==0.10.0; python_full_version >= "3.6.1" and python_version < "4.0"
|
pep8-naming==0.10.0; python_full_version >= "3.6.2" and python_version < "4.0"
|
||||||
pep8==1.7.1; python_full_version >= "3.6.1" and python_version < "4.0"
|
pep8==1.7.1; python_full_version >= "3.6.2" and python_version < "4.0"
|
||||||
platformdirs==2.4.1; python_full_version >= "3.6.2" and python_version < "4.0" and python_version >= "3.7"
|
platformdirs==2.4.1; python_full_version >= "3.6.2" and python_version < "4.0" and python_version >= "3.7"
|
||||||
pluggy==1.0.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
|
pluggy==1.0.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
|
||||||
prospector==1.5.3.1; python_full_version >= "3.6.1" and python_version < "4.0"
|
prospector==1.6.0; python_full_version >= "3.6.2" and python_version < "4.0"
|
||||||
ptyprocess==0.7.0; sys_platform != "win32" and python_version >= "3.6"
|
ptyprocess==0.7.0; sys_platform != "win32" and python_version >= "3.6"
|
||||||
py==1.11.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
py==1.11.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
|
||||||
pycodestyle==2.8.0; python_full_version >= "3.6.1" and python_version < "4.0"
|
pycodestyle==2.8.0; python_full_version >= "3.6.2" and python_version < "4.0"
|
||||||
pydocstyle==6.1.1; python_full_version >= "3.6.1" and python_version < "4.0" and python_version >= "3.6"
|
pydocstyle==6.1.1; python_full_version >= "3.6.2" and python_version < "4.0" and python_version >= "3.6"
|
||||||
pyflakes==2.3.1; python_full_version >= "3.6.1" and python_version < "4.0"
|
pyflakes==2.3.1; python_full_version >= "3.6.2" and python_version < "4.0"
|
||||||
pylint-celery==0.3; python_full_version >= "3.6.1" and python_version < "4.0"
|
pylint-celery==0.3; python_full_version >= "3.6.2" and python_version < "4.0"
|
||||||
pylint-django==2.4.4; python_full_version >= "3.6.1" and python_version < "4.0"
|
pylint-django==2.5.0; python_full_version >= "3.6.2" and python_version < "4.0"
|
||||||
pylint-flask==0.6; python_full_version >= "3.6.1" and python_version < "4.0"
|
pylint-flask==0.6; python_full_version >= "3.6.2" and python_version < "4.0"
|
||||||
pylint-plugin-utils==0.6; python_full_version >= "3.6.1" and python_version < "4.0"
|
pylint-plugin-utils==0.7; python_full_version >= "3.6.2" and python_version < "4.0"
|
||||||
pylint==2.12.2; python_full_version >= "3.6.2" and python_version < "4.0"
|
pylint==2.12.2; python_full_version >= "3.6.2" and python_version < "4.0"
|
||||||
pyparsing==3.0.6; python_version >= "3.6"
|
pyparsing==3.0.7; python_version >= "3.6"
|
||||||
pytest-datadir==1.3.1; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.4.0")
|
pytest-datadir==1.3.1; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.4.0")
|
||||||
pytest-forked==1.4.0; python_version >= "3.6"
|
pytest-forked==1.4.0; python_version >= "3.6"
|
||||||
pytest-xdist==2.5.0; python_version >= "3.6"
|
pytest-xdist==2.5.0; python_version >= "3.6"
|
||||||
pytest==6.2.5; python_version >= "3.6"
|
pytest==6.2.5; python_version >= "3.6"
|
||||||
pyyaml==6.0; python_version >= "3.6"
|
pyyaml==6.0; python_version >= "3.6"
|
||||||
requests==2.26.0; python_version >= "3.5" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.5"
|
requests==2.27.1; python_version >= "3.5" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.5"
|
||||||
requirements-detector==0.7; python_full_version >= "3.6.1" and python_version < "4.0"
|
requirements-detector==0.7; python_full_version >= "3.6.2" and python_version < "4.0"
|
||||||
safety==1.10.3; python_version >= "3.5"
|
safety==1.10.3; python_version >= "3.5"
|
||||||
setoptconf-tmp==0.3.1; python_full_version >= "3.6.1" and python_version < "4.0"
|
setoptconf-tmp==0.3.1; python_full_version >= "3.6.2" and python_version < "4.0"
|
||||||
smmap==5.0.0; python_full_version >= "3.6.1" and python_version < "4.0" and python_version >= "3.7"
|
smmap==5.0.0; python_full_version >= "3.6.2" and python_version < "4.0" and python_version >= "3.7"
|
||||||
snowballstemmer==2.2.0; python_full_version >= "3.6.1" and python_version < "4.0" and python_version >= "3.6"
|
snowballstemmer==2.2.0; python_full_version >= "3.6.2" and python_version < "4.0" and python_version >= "3.6"
|
||||||
stevedore==3.5.0; python_full_version >= "3.6.1" and python_version < "4.0" and python_version >= "3.6"
|
stevedore==3.5.0; python_full_version >= "3.6.2" and python_version < "4.0" and python_version >= "3.7"
|
||||||
toml==0.10.2; (python_version >= "2.6" and python_full_version < "3.0.0") or (python_full_version >= "3.3.0")
|
toml==0.10.2; python_full_version >= "3.6.2" and python_version < "4.0" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.6") and python_version >= "3.5" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6") and (python_version >= "3.5" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.5")
|
||||||
typed-ast==1.4.3; python_version < "3.8" and python_version >= "3.5" and python_full_version >= "3.6.2" and implementation_name == "cpython"
|
typed-ast==1.4.3; python_version < "3.8" and python_version >= "3.5" and python_full_version >= "3.6.2" and implementation_name == "cpython"
|
||||||
types-pyyaml==6.0.1
|
types-pyyaml==6.0.3
|
||||||
types-toml==0.10.1
|
|
||||||
typing-extensions==4.0.1; python_full_version >= "3.6.2" and python_version < "3.8" and python_version >= "3.7"
|
typing-extensions==4.0.1; python_full_version >= "3.6.2" and python_version < "3.8" and python_version >= "3.7"
|
||||||
urllib3==1.26.7; python_version >= "3.5" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version < "4" and python_version >= "3.5"
|
urllib3==1.26.8; python_version >= "3.5" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version < "4" and python_version >= "3.5"
|
||||||
wrapt==1.13.3; python_full_version >= "3.6.2" and python_version < "4.0"
|
wrapt==1.13.3; python_full_version >= "3.6.2" and python_version < "4.0"
|
||||||
zipp==3.7.0; python_version < "3.8" and python_version >= "3.7"
|
zipp==3.7.0; python_version < "3.8" and python_version >= "3.7"
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ package_data = \
|
|||||||
{'': ['*']}
|
{'': ['*']}
|
||||||
|
|
||||||
install_requires = \
|
install_requires = \
|
||||||
['PyYAML>=6.0,<7.0', 'toml>=0.10.0,<0.11.0']
|
['PyYAML']
|
||||||
|
|
||||||
setup_kwargs = {
|
setup_kwargs = {
|
||||||
'name': 'panaetius',
|
'name': 'panaetius',
|
||||||
'version': '2.3.4',
|
'version': '2.3.5',
|
||||||
'description': 'Python module to gracefully handle a .config file/environment variables for scripts, with built in masking for sensitive options. Provides a Splunk friendly formatted logger instance.',
|
'description': 'Python module to gracefully handle a .config file/environment variables for scripts, with built in masking for sensitive options. Provides a Splunk friendly formatted logger instance.',
|
||||||
'long_description': '# Panaetius\n\nThis package provides:\n\n- Functionality to read user variables from a `config.yml` or environment variables.\n- A convenient default logging formatter printing `json` that can save to disk and rotate.\n- Utility functions.\n\n## Config\n\n### options\n\n#### skip_header_init\n\nIf `skip_header_init=True` then the `config_path` will not use the `header_variable` as the\nsub-directory in the `config_path`.\n\nE.g\n\n`CONFIG = panaetius.Config("tembo", "~/tembo/.config", skip_header_init=True)`\n\nWill look in `~/tembo/config/config.yml`.\n\nIf `skip_header_init=False` then would look in `~/tembo/config/tembo/config.yml`.\n\n### Module\n\nConvenient to place in a package/sub-package `__init__.py`.\n\nSee Tembo for an example: <https://github.com/tembo-pages/tembo-core/blob/main/tembo/cli/__init__.py>\n\nExample snippet to use in a module:\n\n```python\n"""Subpackage that contains the CLI application."""\n\nimport os\nfrom typing import Any\n\nimport panaetius\nfrom panaetius.exceptions import LoggingDirectoryDoesNotExistException\n\n\nif (config_path := os.environ.get("TEMBO_CONFIG")) is not None:\n CONFIG: Any = panaetius.Config("tembo", config_path, skip_header_init=True)\nelse:\n CONFIG = panaetius.Config(\n "tembo", "~/tembo/.config", skip_header_init=True\n )\n\n\npanaetius.set_config(CONFIG, "base_path", "~/tembo")\npanaetius.set_config(CONFIG, "template_path", "~/tembo/.templates")\npanaetius.set_config(CONFIG, "scopes", {})\npanaetius.set_config(CONFIG, "logging.level", "DEBUG")\npanaetius.set_config(CONFIG, "logging.path")\n\ntry:\n logger = panaetius.set_logger(\n CONFIG, panaetius.SimpleLogger(logging_level=CONFIG.logging_level)\n )\nexcept LoggingDirectoryDoesNotExistException:\n _LOGGING_PATH = CONFIG.logging_path\n CONFIG.logging_path = ""\n logger = panaetius.set_logger(\n CONFIG, panaetius.SimpleLogger(logging_level=CONFIG.logging_level)\n )\n logger.warning("Logging directory %s does not exist", _LOGGING_PATH)\n\n```\n\nThis means in `./tembo/cli/cli.py` you can\n\n```python\nimport tembo.cli\n\n# access the CONFIG instance + variables from the config.yml\ntembo.cli.CONFIG\n```\n\n### Script\n\nCreate `./config/config.yml` in the same directory as the script.\n\nIn the script initialise a `CONFIG` object:\n\n```python\nimport pathlib\n\nimport panaetius\n\nCONFIG = panaetius.Config(\n "teenagers_scraper", str(pathlib.Path(__file__).parents[0] / ".config"), skip_header_init=True\n)\n```\n\nSet variables in the same way as the module above.\n\n#### quickstart logging\n\n```python\nimport panaetius\n\n\ndef get_logger():\n logging_dir = pathlib.Path(__file__).parents[0] / "logs"\n logging_dir.mkdir(parents=True, exist_ok=True)\n\n CONFIG = panaetius.Config("training_data_into_gcp", skip_header_init=True)\n panaetius.set_config(CONFIG, "logging.level", "DEBUG")\n panaetius.set_config(CONFIG, "logging.path", logging_dir)\n return panaetius.set_logger(CONFIG, panaetius.SimpleLogger(logging_level=CONFIG.logging_level))\n```\n\n## Utility Functions\n\n### Squasher\n\nSquashes a json object or Python dictionary into a single level dictionary.\n',
|
'long_description': '# Panaetius\n\nThis package provides:\n\n- Functionality to read user variables from a `config.yml` or environment variables.\n- A convenient default logging formatter printing `json` that can save to disk and rotate.\n- Utility functions.\n\n## Config\n\n### options\n\n#### skip_header_init\n\nIf `skip_header_init=True` then the `config_path` will not use the `header_variable` as the\nsub-directory in the `config_path`.\n\nE.g\n\n`CONFIG = panaetius.Config("tembo", "~/tembo/.config", skip_header_init=True)`\n\nWill look in `~/tembo/config/config.yml`.\n\nIf `skip_header_init=False` then would look in `~/tembo/config/tembo/config.yml`.\n\n### Module\n\nConvenient to place in a package/sub-package `__init__.py`.\n\nSee Tembo for an example: <https://github.com/tembo-pages/tembo-core/blob/main/tembo/cli/__init__.py>\n\nExample snippet to use in a module:\n\n```python\n"""Subpackage that contains the CLI application."""\n\nimport os\nfrom typing import Any\n\nimport panaetius\nfrom panaetius.exceptions import LoggingDirectoryDoesNotExistException\n\n\nif (config_path := os.environ.get("TEMBO_CONFIG")) is not None:\n CONFIG: Any = panaetius.Config("tembo", config_path, skip_header_init=True)\nelse:\n CONFIG = panaetius.Config(\n "tembo", "~/tembo/.config", skip_header_init=True\n )\n\n\npanaetius.set_config(CONFIG, "base_path", "~/tembo")\npanaetius.set_config(CONFIG, "template_path", "~/tembo/.templates")\npanaetius.set_config(CONFIG, "scopes", {})\npanaetius.set_config(CONFIG, "logging.level", "DEBUG")\npanaetius.set_config(CONFIG, "logging.path")\n\ntry:\n logger = panaetius.set_logger(\n CONFIG, panaetius.SimpleLogger(logging_level=CONFIG.logging_level)\n )\nexcept LoggingDirectoryDoesNotExistException:\n _LOGGING_PATH = CONFIG.logging_path\n CONFIG.logging_path = ""\n logger = panaetius.set_logger(\n CONFIG, panaetius.SimpleLogger(logging_level=CONFIG.logging_level)\n )\n logger.warning("Logging directory %s does not exist", _LOGGING_PATH)\n\n```\n\nThis means in `./tembo/cli/cli.py` you can\n\n```python\nimport tembo.cli\n\n# access the CONFIG instance + variables from the config.yml\ntembo.cli.CONFIG\n```\n\n### Script\n\nCreate `./config/config.yml` in the same directory as the script.\n\nIn the script initialise a `CONFIG` object:\n\n```python\nimport pathlib\n\nimport panaetius\n\nCONFIG = panaetius.Config(\n "teenagers_scraper", str(pathlib.Path(__file__).parents[0] / ".config"), skip_header_init=True\n)\n```\n\nSet variables in the same way as the module above.\n\n#### quickstart logging\n\n```python\nimport panaetius\n\n\ndef get_logger():\n logging_dir = pathlib.Path(__file__).parents[0] / "logs"\n logging_dir.mkdir(parents=True, exist_ok=True)\n\n CONFIG = panaetius.Config("training_data_into_gcp", skip_header_init=True)\n panaetius.set_config(CONFIG, "logging.level", "DEBUG")\n panaetius.set_config(CONFIG, "logging.path", logging_dir)\n return panaetius.set_logger(CONFIG, panaetius.SimpleLogger(logging_level=CONFIG.logging_level))\n```\n\n## Utility Functions\n\n### Squasher\n\nSquashes a json object or Python dictionary into a single level dictionary.\n',
|
||||||
'author': 'dtomlinson',
|
'author': 'dtomlinson',
|
||||||
|
|||||||
Reference in New Issue
Block a user