Skip to main content

A basic config package that reads a JSON config file, environment variables, and console arguments (prioritized in that order)

Project description

PrefRef

Config init in __main__

Subsection

example code

Boolean Arguments

There are two types of boolean arguments supported as a Config_Option, the property 'is_flag' will determine how the boolean is handled.

If 'is_flag' is true, the option can only be set by environment variable or console argument and cannot be stored in a config file. Passing the argument or having the environment variable existing, with or without explicitly setting it to a true/false value, will set the Config_Option value to True. Otherwise, the value will be set to the default value of the Config_Option.

If 'is_flag' is false, the option can also be stored in a config file. You can either pass the console argument or have the environment variable set without an explicit statement of true/false to set it to True OR set it explicitly by passing/setting the value to true or false.

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

prefref-24.12.2801.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

prefref-24.12.2801-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file prefref-24.12.2801.tar.gz.

File metadata

  • Download URL: prefref-24.12.2801.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for prefref-24.12.2801.tar.gz
Algorithm Hash digest
SHA256 40a068022539dbd9adaac3e24337f6d9f378b9c91e2867a4193a5a784179fe08
MD5 27f55ac59c54647108d0e94fa5a67632
BLAKE2b-256 1f0fec89dea44004f6acdafa627164912782e02a8ad8a6b938d5e9cb4d4763f2

See more details on using hashes here.

File details

Details for the file prefref-24.12.2801-py3-none-any.whl.

File metadata

  • Download URL: prefref-24.12.2801-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for prefref-24.12.2801-py3-none-any.whl
Algorithm Hash digest
SHA256 5c1690bce932451a920ee55f45269477759da60c08aecbd1a9b093f0ab0bace0
MD5 adfba9f11cf67b3314058c7a00f23d5e
BLAKE2b-256 bc40e063de6e9eaf04ed194d7f4bf34a4c6ba7b26155977aff4c55bcc1f18e76

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