METADATA 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. Metadata-Version: 2.1
  2. Name: iniconfig
  3. Version: 2.0.0
  4. Summary: brain-dead simple config-ini parsing
  5. Project-URL: Homepage, https://github.com/pytest-dev/iniconfig
  6. Author-email: Ronny Pfannschmidt <opensource@ronnypfannschmidt.de>, Holger Krekel <holger.krekel@gmail.com>
  7. License-Expression: MIT
  8. License-File: LICENSE
  9. Classifier: Development Status :: 4 - Beta
  10. Classifier: Intended Audience :: Developers
  11. Classifier: License :: OSI Approved :: MIT License
  12. Classifier: Operating System :: MacOS :: MacOS X
  13. Classifier: Operating System :: Microsoft :: Windows
  14. Classifier: Operating System :: POSIX
  15. Classifier: Programming Language :: Python :: 3
  16. Classifier: Programming Language :: Python :: 3 :: Only
  17. Classifier: Programming Language :: Python :: 3.7
  18. Classifier: Programming Language :: Python :: 3.8
  19. Classifier: Programming Language :: Python :: 3.9
  20. Classifier: Programming Language :: Python :: 3.10
  21. Classifier: Programming Language :: Python :: 3.11
  22. Classifier: Topic :: Software Development :: Libraries
  23. Classifier: Topic :: Utilities
  24. Requires-Python: >=3.7
  25. Description-Content-Type: text/x-rst
  26. iniconfig: brain-dead simple parsing of ini files
  27. =======================================================
  28. iniconfig is a small and simple INI-file parser module
  29. having a unique set of features:
  30. * maintains order of sections and entries
  31. * supports multi-line values with or without line-continuations
  32. * supports "#" comments everywhere
  33. * raises errors with proper line-numbers
  34. * no bells and whistles like automatic substitutions
  35. * iniconfig raises an Error if two sections have the same name.
  36. If you encounter issues or have feature wishes please report them to:
  37. https://github.com/RonnyPfannschmidt/iniconfig/issues
  38. Basic Example
  39. ===================================
  40. If you have an ini file like this:
  41. .. code-block:: ini
  42. # content of example.ini
  43. [section1] # comment
  44. name1=value1 # comment
  45. name1b=value1,value2 # comment
  46. [section2]
  47. name2=
  48. line1
  49. line2
  50. then you can do:
  51. .. code-block:: pycon
  52. >>> import iniconfig
  53. >>> ini = iniconfig.IniConfig("example.ini")
  54. >>> ini['section1']['name1'] # raises KeyError if not exists
  55. 'value1'
  56. >>> ini.get('section1', 'name1b', [], lambda x: x.split(","))
  57. ['value1', 'value2']
  58. >>> ini.get('section1', 'notexist', [], lambda x: x.split(","))
  59. []
  60. >>> [x.name for x in list(ini)]
  61. ['section1', 'section2']
  62. >>> list(list(ini)[0].items())
  63. [('name1', 'value1'), ('name1b', 'value1,value2')]
  64. >>> 'section1' in ini
  65. True
  66. >>> 'inexistendsection' in ini
  67. False