Package: pyspry
A Springy Little Configuration ReaderInfluenced bySpring Boot's YAML configuration features,
this library reads system configuration settings from environment variables and YAML files.InstallationTo install usingpip:pipinstallpyspryUsageBy default, a file namedconfig.ymlin the current directory will be loaded and parsed for
configuration settings. These can be accessed through thepyspry.settingsmodule.For example, consider the followingconfig.ymlfile:DATABASES:default:AUTOCOMMIT:trueNAME:db.sqlite3DEBUG:trueDEFAULT_CHARSET:utf-8These configuration settings can be accessed as follows:>>>frompyspryimportsettings>>>settings.DEBUGTrue>>>settings.DEFAULT_CHARSET'utf-8'Specifying Alternate Config FilesSet the environment variablePYSPRY_CONFIG_PATHto override the default path to the configuration
file:>>>importos;os.environ["PYSPRY_CONFIG_PATH"]'sample-config.yml'>>>frompyspryimportsettings>>>settings.PYSPRY_STATICFILES_FINDERS['django.contrib.staticfiles.finders.FileSystemFinder','django.contrib.staticfiles.finders.AppDirectoriesFinder']Variable PrefixesSet the environment variablePYSPRY_VAR_PREFIXto filter which settings are loaded:>>>importos;os.environ["PYSPRY_VAR_PREFIX"]'PYSPRY'>>>frompyspryimportsettings>>>"TEST_RUNNER"insettings# the prefix is automatically insertedTrue>>>"IGNORED_SETTING"insettings# see the last line in 'sample-config.yml'FalseNested StructuresIf the configuration includes nested data structures, each layer of nesting can be traversed using_-separated names:>>>settings.LOGGING["version"]==settings.LOGGING_version==1True>>>settings.LOGGING["loggers"]["pyspry"]["level"]==\...settings.LOGGING_loggers_pyspry_level=='DEBUG'TrueEnvironment VariablesIn many cases, it can be useful to set one-off overrides for a setting. This can be done with an
environment variable:>>>importimportlib,os>>>settings.LOGGING_loggers_pyspry_level'DEBUG'>>>os.environ["PYSPRY_LOGGING_loggers_pyspry_level"]="INFO">>>settings=importlib.reload(settings)>>>settings.LOGGING["loggers"]["pyspry"]["level"]'INFO'Django IntegrationThis package was originally designed for use with theDjangoframework. To use it:# after installing the package, specify it as the settings moduleexportDJANGO_SETTINGS_MODULE=pyspry.settings

django-admindiffsettingsDevelopmentThe following system dependencies are required:poetrypre-commit(optional)direnv(optional)dockerCommon development commands are managed bypoethepoet; runpoe --helpfor an up-to-date list of commands:Poe the Poet - A task runner that works well with poetry.
version 0.20.0

USAGE
  poe [-h] [-v | -q] [--root PATH] [--ansi | --no-ansi] task [task arguments]

GLOBAL OPTIONS
  -h, --help     Show this help page and exit
  --version      Print the version and exit
  -v, --verbose  Increase command output (repeatable)
  -q, --quiet    Decrease command output (repeatable)
  -d, --dry-run  Print the task contents but don't actually run it
  --root PATH    Specify where to find the pyproject.toml
  --ansi         Force enable ANSI output
  --no-ansi      Force disable ANSI output

CONFIGURED TASKS
  setup-versioning  Install the 'poetry-dynamic-versioning' plugin to the local 'poetry' installation
  docs              Generate this package's docs
  docserver         Use 'pdoc' to launch an HTTP server for this package's docs
  lab               Run Jupyter Lab
  lint              Lint this package
  test              Test this package and report coverageReportsbanditmypypytestcoverage