Skip to main content

Settings management using Pydantic, with ability to retrieve cloud secrets.

Project description

Settus

Settings management using Pydantic Settings and extended to secrets from Azure Keyvault, Databricks secrets [IN PROGRESS], AWS Secrets Manager [IN PROGRESS] and GCP Secrets Manager [IN PROGRESS]

Okube Company

Okube is committed to develop open source data engineering and ML engineering tools. Contributions are more than welcome.

Installation

Install using pip install -U settus[{cloud_provider}] where {cloud_provider} is the cloud provider(s) you want to fetch secrets from. Possible options are:

  • azure
  • aws
  • gcp
  • databricks

Getting started

Settus uses Pydantic Settings management as its foundation. In addition, it defines the settings sources mentioned below to fetch secrets from cloud providers. The default priority order is as follows:

  • Init Settings
  • Environment variables
  • Azure KeyVault
  • AWS Secrets Manager
  • GCP Secrets Manager
  • Databricks secrets

In other words, if a setting is not available from the initialization or from an environment variable, it wil sequentially lookup the field name (or aliases) in the other available sources.

Azure Key Vault

By providing the keyvault_url to the SettingsConfigDict or to a given field. The keyvault credentials can also be provided. Otherwise, the DefaultAzureCredential is used. Similarly to environment variables, aliases may be used to set the key of the secrets.

AWS Secrets Manager

TODO

GCP Secrets Manager

TODO

Databricks Secrets

TODO

A Simple Example

import os
from settus import BaseSettings
from settus import Field
from settus import SettingsConfigDict

KEYVAULT_URL = "https://my-keyvault.vault.azure.net/"

os.environ["MY_ENV"] = "my_value"

class Settings(BaseSettings):
    model_config = SettingsConfigDict(keyvault_url="https://my-keyvault.vault.azure.net/")
    my_env: str = Field(default="undefined")  # value from ENV VAR
    my_secret: str = Field(default="undefined", alias="my-secret")  # value from KeyVault

settings = ()
print(settings.my_env)
#> my_value
print(settings.my_secret)
#> secret_sauce

Contributing

TODO

Reporting a Security Vulnerability

TODO

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

settus-0.0.4.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

settus-0.0.4-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file settus-0.0.4.tar.gz.

File metadata

  • Download URL: settus-0.0.4.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for settus-0.0.4.tar.gz
Algorithm Hash digest
SHA256 7fb7ee4cac6ca097c060a7651265153d5b4d30f30b78af81efbf3a0e5624d977
MD5 498b24a794a6c2558eb505e2eda498b5
BLAKE2b-256 b10921adadff4a580de8d316a17a90d4620e52d4418734d0fb4c44af8e26d19a

See more details on using hashes here.

File details

Details for the file settus-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: settus-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for settus-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c138f42cc9ec5246fe0690c2320bc9384d00335a0736087799c7fe62789139e6
MD5 15d7a7de76dfc01ae140e064cf8a3166
BLAKE2b-256 053a4ad8c3839dc58fc56a0aa1c6e87babb85fc3ad8142bb51481e9bb624686b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page