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.2.2100.tar.gz (9.2 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.2.2100-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for prefref-25.2.2100.tar.gz
Algorithm Hash digest
SHA256 89c9c18e510289a63ea78cbcf0a053244532499afd3f1295b61c917e0c78524a
MD5 b637d5f294dc78d14e1e9f700824b119
BLAKE2b-256 020ea3407216f6c334f7c400a0d787a39554d2b73c49e7eb5e2a69a081906575

See more details on using hashes here.

File details

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

File metadata

  • Download URL: prefref-25.2.2100-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.2.2100-py3-none-any.whl
Algorithm Hash digest
SHA256 1b9f52342509fea76d33f3a3830b8459cb13e85b85bef8ba6eb0afcfc45c4faf
MD5 748c8bb638dbb6d9695c6304835acd22
BLAKE2b-256 7b3e28236117544e59f8234bb4ed51303b383ff55c69ca57c1a941590015b0a5

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