Tristan Nolde 0cca5f429e
feat(config): Read secrets from .env file and environemnt variables (#109)
Config variables used to connect to our two databased can now also be
ingested from the local environment variables. Such variables can also
be passed in using a `.env` file as described in the README.md
2023-09-09 18:41:56 +02:00
2023-09-07 18:41:10 +02:00
2023-09-09 18:22:20 +02:00

aki_prj23_transparenzregister

python Actions status Ruff pre-commit Checked with mypy Documentation Status Code style: black

Contributions

See the CONTRIBUTING.md about how code should be formatted and what kind of rules we set ourselves.

DB Connection settings

To connect to the SQL db see sql/connector.py To connect to the Mongo db see [connect]

Create a secrets.json in the root of this repo with the following structure (values to be replaces by desired config):

   {
  "postgres": {
    "username": "postgres",
    "password": "postgres",
    "host": "localhost",
    "database": "postgres",
    "port": 5432
  },
  "mongo": {
    "username": "username",
    "password": "password",
    "host": "localhost",
    "database": "transparenzregister",
    "port": 27017
  }
}

Alternatively, the secrets can be provided as environment variables. One option to do so is to add a .env file with the following layout:

PYTHON_POSTGRES_USERNAME=postgres
PYTHON_POSTGRES_PASSWORD=postgres
PYTHON_POSTGRES_HOST=localhost
PYTHON_POSTGRES_DATABASE=postgres
PYTHON_POSTGRES_PORT=5432
PYTHON_MONGO_USERNAME=username
PYTHON_MONGO_HOST=localhost
PYTHON_MONGO_PASSWORD=password
PYTHON_MONGO_PORT=27017
PYTHON_MONGO_DATABASE=transparenzregister

The prefix PYTHON_ can be customized by setting a different prefix when constructing the ConfigProvider.

Description
No description provided
Readme 138 MiB
Languages
Jupyter Notebook 84.5%
HTML 12.1%
Python 3.3%