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.2.701.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

prefref-24.2.701-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for prefref-24.2.701.tar.gz
Algorithm Hash digest
SHA256 7b0d6d66ed477a22ee3e356de0313273d8d708cadbc251509ca2ba02e2299824
MD5 83aa85fc84fad6f3563b725b79866d98
BLAKE2b-256 77ea51fbb6452e8d8c83a50ad904854890e2d711bfcae8b40b63650dfa700a0d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: prefref-24.2.701-py3-none-any.whl
  • Upload date:
  • Size: 8.0 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.2.701-py3-none-any.whl
Algorithm Hash digest
SHA256 c48c334553a4898e54bae86be67e206d4bda49642a3d69e539260d3a1f990a6d
MD5 7423822eda5a680766a8fbe3f4b37e5d
BLAKE2b-256 a156cb531f9cade41247bfb5ae2bbadac93c94582a4b1e4b9765113ee8022c52

See more details on using hashes here.

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