Skip to main content

This library created for comfortable using config

Project description

Example:

ENG:

import suprconfig.config as config # import module

cfg = config.Config("config.json") # Creating an instance of a class

cfg.add(name = "app-name", value = "suprconfig") # Creating the "app-name" variable with the value "suprconfig" in the config.

cfg.add(name = "version", value = "v1.0") # Creating the "version" variable with the value "v1.0" in the config.

app_name = cfg.get('app-name') # Recording the value of the "app-name" variable from the config. (if no argument is specified, the function will return all variables and config values).
version = cfg.get('version') # Recording the value of the "version" variable from the config. (if no argument is specified, the function will return all variables and config values).

print(f"App Name: {app_name}
Version: {version}") # Information output to the terminal

RUS:

import suprconfig.config as config # Импорт модуля.

cfg = config.Config("config.json") # Создание экземпляра класса.

cfg.add(name = "app-name", value = "suprconfig") # Создание переменной "app-name" со значением "suprconfig" в конфиг.

cfg.add(name = "version", value = "v1.0") # Создание переменной "version" со значением "v1.0" в конфиг.

app_name = cfg.get('app-name') # Запись значение переменной "app-name" из конфига. (если аргумент не указан, функция вернет все переменные и значения конфига).
version = cfg.get('version') # Запись значение переменной "version" из конфига. (если аргумент не указан, функция вернет все переменные и значения конфига).

print(f"App Name: {app_name}
Version: {version}") # Вывод информации в терминал.

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

suprconfig-0.4.tar.gz (2.3 kB view details)

Uploaded Source

File details

Details for the file suprconfig-0.4.tar.gz.

File metadata

  • Download URL: suprconfig-0.4.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for suprconfig-0.4.tar.gz
Algorithm Hash digest
SHA256 aeec2ccbe4554191e3bb859ef9e4959e3e65fd4b77bc5a093849b3d13be809e1
MD5 a40f16889fda6adf5d5eac85fb78faf0
BLAKE2b-256 341ef5da057c3559cc39252869371c5a80cbd402c837d0c72761162c13a3160e

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