Skip to main content

Simple, super-flexible options. Does magic upon request.

Project description

options helps encapsulate options and configuration data using a layered stacking model (a.k.a. nested contexts).

For most functions and many classes, options is overkill and not recommended. Python’s already-flexible function arguments, *args, **kwargs, and inheritance patterns are elegant and sufficient for 99.9% of all development situations. options is for the other 0.1%:

  • highly functional classes,
  • with many different features and options,
  • which might be adjusted or overriden at any time,
  • yet that need “reasonable” or “intelligent” defaults, and
  • that yearn for a simple, unobtrusive API.

In those cases, Python’s simpler built-in, inheritance-based model adds complexity as non-trivial options and argument-management code spreads through many individual methods. This is where options’s delegation-based approach begins to shine.

For more backstory, see this discussion of how to combat “configuration sprawl”. options full documentation can be found at Read the Docs. For examples of options in use, see say and show.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for options, version 1.1.2
Filename, size File type Python version Upload date Hashes
Filename, size options-1.1.2.tar.gz (210.5 kB) File type Source Python version None Upload date Hashes View
Filename, size (224.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page