Skip to content

husseinamine/inipy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

a lightweight ini parser

how to install

pip install ini.py

converts an ini file to a python dictionary

example ini file

; main section
[section]
key = value
key2 = "value2"
key3 = 'value3'

reading it using ini.py

import ini

text = open('config.ini', 'r').read()

config = ini.parse(text)

section = config['section']

print(section['key'], section['key2'], section['key3'])

output

value value2 value3

converting python dict to ini

import ini

config = ini.convert({"section": {"key": "value"}, "section2": {"key2": "value2"}})


print(config)

output

[section]
key = value

[section2]
key2 = value2

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages