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

Uploaded Source

Built Distribution

prefref-24.5.700-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for prefref-24.5.700.tar.gz
Algorithm Hash digest
SHA256 32faf3df4974c15c57c38bf342ba8c69846cf199a4569ea0f29c97a4b5c3d224
MD5 6a037e6e8e4aa99ca330432188a0432d
BLAKE2b-256 04191147d8aff49265b009132c870cc00635632480eb182c23cb369cdcd11b74

See more details on using hashes here.

File details

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

File metadata

  • Download URL: prefref-24.5.700-py3-none-any.whl
  • Upload date:
  • Size: 8.1 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.5.700-py3-none-any.whl
Algorithm Hash digest
SHA256 1ec6d044ea4d11fbd84b34b4957c5b8815120f27f71129d55d885683ea3dc814
MD5 7e8175dea35930cc703c3cde33a47719
BLAKE2b-256 22aee41dd831a854ee5998d9baaa2aa83f79c064d6a0ba6732c0a2ac4e8b0a31

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