METADATA 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. Metadata-Version: 2.1
  2. Name: setoptconf-tmp
  3. Version: 0.3.1
  4. Summary: A module for retrieving program settings from various sources in a consistant method.
  5. Home-page: https://github.com/carlio/setoptconf-tmp
  6. Author: Jason Simeone
  7. Author-email: jay@classless.net
  8. Maintainer: Carl Crowder
  9. Maintainer-email: git@carlcrowder.com
  10. License: MIT
  11. Keywords: settings,options,configuration,config,arguments
  12. Platform: UNKNOWN
  13. Classifier: Development Status :: 4 - Beta
  14. Classifier: Intended Audience :: Developers
  15. Classifier: License :: OSI Approved :: MIT License
  16. Classifier: Operating System :: OS Independent
  17. Classifier: Programming Language :: Python :: 3.6
  18. Classifier: Programming Language :: Python :: 3.7
  19. Classifier: Programming Language :: Python :: 3.8
  20. Classifier: Programming Language :: Python :: 3.9
  21. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  22. License-File: LICENSE
  23. Provides-Extra: yaml
  24. Requires-Dist: pyyaml ; extra == 'yaml'
  25. ==========
  26. IMPORTANT!
  27. ==========
  28. This is a fork of `setoptconf <https://github.com/jayclassless/setoptconf>`_ .
  29. It is a temporary solution to fix `prospector <https://github.com/PyCQA/prospector>`_
  30. being unable to install due to setoptconf not working with setuptools >= 58 -
  31. see `the issue here <https://github.com/PyCQA/prospector/issues/438>`_.
  32. This package is only meant as a temporary solution to fix CI builds using prosector
  33. until setoptconf can be removed from there. Therefore do not expect this fork to be
  34. maintained and it will be purged once prospector is updated.
  35. ==============
  36. setoptconf-tmp
  37. ==============
  38. ``setoptconf`` is a Python library that can be used to retrieve program settings
  39. from a variety of common sources:
  40. * Command Line
  41. * Environment Variables
  42. * INI Files
  43. * JSON Files
  44. * YAML Files
  45. * Python Objects/Modules
  46. The goal of this project is to define your desired settings in a simple and
  47. consistent way, and then point setoptconf at as many of the sources as you'd
  48. like to use, and let it comb them all, looking for your settings.
  49. This README is admittedly very light on details. Full documentation will come
  50. in time. For now, here's an example of its use:
  51. Import the library::
  52. import setoptconf as soc
  53. Instantiate the manager::
  54. manager = soc.ConfigurationManager('myprogram')
  55. Define the settings we'd like to collect::
  56. manager.add(soc.StringSetting('foo'))
  57. manager.add(soc.IntegerSetting('bar', required=True))
  58. manager.add(soc.BooleanSetting('baz', default=True))
  59. Retreive the settings from our desired sources, combining the settings and
  60. overriding with the priority implied by the order of the sources we pass::
  61. config = manager.retrieve(
  62. # This source pulls from the command line using argparse.
  63. soc.CommandLineSource,
  64. # This source pulls from environment variables that are prefixed
  65. # with MYPROGRAM_*
  66. soc.EnvironmentVariableSource,
  67. # This source pulls from the named INI files. It stops at the first
  68. # file it finds.
  69. soc.ConfigFileSource(('.myprogramrc', '/etc/myprogram.conf')),
  70. )
  71. We now have a Configuration object named ``config`` that has three attributes;
  72. ``foo``, ``bar``, and ``baz``.