METADATA 2.5 KB

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