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

Uploaded Source

Built Distribution

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

prefref-25.1.2101-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for prefref-25.1.2101.tar.gz
Algorithm Hash digest
SHA256 0549c0a1b113e1d554ee3c39304fdfad87d6750f4346af6cdd655328c55d5eb2
MD5 6bc3a2c711515f5d02e1ea93083e790d
BLAKE2b-256 f8f552822b5e9bf6e11812a3a7e53514d6298c27154bea0fd264f5150b0a2435

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for prefref-25.1.2101-py3-none-any.whl
Algorithm Hash digest
SHA256 b71b5e5e72d16bfe1faff7f6f240b942d9a34f7fd181517543c7f167a7f1d1fe
MD5 aede443eac05f3df00e6919a5fe33a51
BLAKE2b-256 5464a38e45f762d34d20a4229de29919ffc81218053a0f95df2008e98b592a4d

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