Metadata-Version: 2.1
Name: dkist-service-configuration
Version: 2.0.0
Summary: Library for retrieving configurations for DKIST services
Author-email: NSO / AURA <dkistdc@nso.edu>
License: BSD 3-Clause
Project-URL: repository, https://bitbucket.org/dkistdc/dkist_service_configuration
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.11
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: loguru >0.7.0
Requires-Dist: pydantic-settings >2.0
Requires-Dist: pydantic[dotenv] >2.0
Provides-Extra: test
Requires-Dist: tox >=4 ; extra == 'test'
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: pytest-cov ; extra == 'test'
Requires-Dist: Pygments ; extra == 'test'
Requires-Dist: PyPDF4 ; extra == 'test'

dkist-service-configuration
===========================

A configuration for the `loguru <https://github.com/Delgan/loguru>`_ logger and base configuration object using `pydantic <https://docs.pydantic.dev/1.10/usage/settings/>`_ base settings.

It is important that it be the first import to run so the standard logging basicConfig method has an effect.

Features
--------

* Stderr output
* Intercepted logging from client libraries
* Disabled better exceptions for log levels above debug to mitigate secret leaking
* Configuration logging with secrets redacted
* DKIST Mesh Service configuration parsing

Installation
------------

.. code:: bash

   pip install dkist-service-configuration


Examples
--------

**config.py**

.. code:: python

    from dkist_service_configuration.logging import logger
    from dkist_service_configuration import MeshServiceConfigurationBase
    logger.debug('hello world)
    class NewConfiguration(MeshServiceConfigurationBase):
        username: str = "me"
        password: str = "pass"
    new_configuration = NewConfiguration()
    new_configuration.log_configurations()

The code above will register the existing loggers, retrieve mesh configuration
and custom configuration from the environment and log it while redacting the
password.
