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

Uploaded Source

Built Distribution

prefref-24.1.1009-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for prefref-24.1.1009.tar.gz
Algorithm Hash digest
SHA256 e61020d77f5f5b9295ed3f076a87b37e29c4b255789d4d33b4199838436fa4e8
MD5 4ed11a0ca47a914d9d97fd1cb027aacd
BLAKE2b-256 0a8ff470cdfdc79762a2ca4d8ab4ddd1646344e59287ba99b2ae601949a81dcc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: prefref-24.1.1009-py3-none-any.whl
  • Upload date:
  • Size: 7.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.1.1009-py3-none-any.whl
Algorithm Hash digest
SHA256 5df3fd54dcfb1df3e30a33ccb00947b2af9731bc28e34ae5abc44d0af093c15f
MD5 cbb343800e586a7c1bb6a44251a39f81
BLAKE2b-256 5ccac066a163fe9e0826f360f23029934a7bea1a08850191727bd1cd7c74e318

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