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

Uploaded Source

Built Distribution

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

prefref-24.12.2803-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for prefref-24.12.2803.tar.gz
Algorithm Hash digest
SHA256 d2396d0386fda8963e24312b1845350b2062adae2cb563996713ad4ec31c3a94
MD5 22efc7d6e51c81055bade48e48575698
BLAKE2b-256 a368b2668f3622899b7f54e11ab44023f1f83aace684a615a4dd8424833a8517

See more details on using hashes here.

File details

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

File metadata

  • Download URL: prefref-24.12.2803-py3-none-any.whl
  • Upload date:
  • Size: 8.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.12.2803-py3-none-any.whl
Algorithm Hash digest
SHA256 6b54404b0280da532f8292699da9d8995f6772446941d219854e32321a3df3ef
MD5 bfaab7dd4ae6ae2c0f7baaa61fa747c5
BLAKE2b-256 8f854726d6b2bfa6ab3deea0754559cebbc1a1d462cc0a595036e74eefda2c99

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