Skip to main content

Enviroment variables to class object with checking for the presence of parameters

Project description

Description

Simple use env settings with class type

install

  pip install env-to-class

import

from env_to_class import Settings

Description

The library allows you to encrypt your settings stored in json format.
It is possible to convert from a simple storage option to an encrypted one. 
To work with the encrypted version of the settings, you need to pass the startup parameter - the password with which the encryption took place.
Try it, the library is very simple.

Usage

Import lib

  required_settings = 'Database.name, Database.user, Database.pwd, Database.host, Clickhouse.host, Clickhouse.user, Clickhouse.pwd'
  settings = Settings(required_settings)

  nameDB = settings.Database.name
  userDB = settings.Database.user
  pwdDb = settings.Database.pwd
  hostDB = settings.Database.host
  clickhouseHost = settings.Clickhouse.host
  clickhousePwd = settings.Clickhouse.pwd
  clickhouseUser = settings.Clickhouse.user

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

env_to_class-1.1.0.tar.gz (2.0 kB view hashes)

Uploaded Source

Built Distribution

env_to_class-1.1.0-py3-none-any.whl (2.1 kB view hashes)

Uploaded Python 3

Supported by

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