METADATA 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. Metadata-Version: 2.1
  2. Name: iniconfig
  3. Version: 1.1.1
  4. Summary: iniconfig: brain-dead simple config-ini parsing
  5. Home-page: http://github.com/RonnyPfannschmidt/iniconfig
  6. Author: Ronny Pfannschmidt, Holger Krekel
  7. Author-email: opensource@ronnypfannschmidt.de, holger.krekel@gmail.com
  8. License: MIT License
  9. Platform: unix
  10. Platform: linux
  11. Platform: osx
  12. Platform: cygwin
  13. Platform: win32
  14. Classifier: Development Status :: 4 - Beta
  15. Classifier: Intended Audience :: Developers
  16. Classifier: License :: OSI Approved :: MIT License
  17. Classifier: Operating System :: POSIX
  18. Classifier: Operating System :: Microsoft :: Windows
  19. Classifier: Operating System :: MacOS :: MacOS X
  20. Classifier: Topic :: Software Development :: Libraries
  21. Classifier: Topic :: Utilities
  22. Classifier: Programming Language :: Python
  23. Classifier: Programming Language :: Python :: 2
  24. Classifier: Programming Language :: Python :: 3
  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. * tested against Python2.4 across to Python3.2, Jython, PyPy
  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. http://github.com/RonnyPfannschmidt/iniconfig/issues
  38. Basic Example
  39. ===================================
  40. If you have an ini file like this::
  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. >>> import iniconfig
  51. >>> ini = iniconfig.IniConfig("example.ini")
  52. >>> ini['section1']['name1'] # raises KeyError if not exists
  53. 'value1'
  54. >>> ini.get('section1', 'name1b', [], lambda x: x.split(","))
  55. ['value1', 'value2']
  56. >>> ini.get('section1', 'notexist', [], lambda x: x.split(","))
  57. []
  58. >>> [x.name for x in list(ini)]
  59. ['section1', 'section2']
  60. >>> list(list(ini)[0].items())
  61. [('name1', 'value1'), ('name1b', 'value1,value2')]
  62. >>> 'section1' in ini
  63. True
  64. >>> 'inexistendsection' in ini
  65. False