Skip to main content

a lightweight ini parser

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ini.py-0.0.3.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

ini.py-0.0.3-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file ini.py-0.0.3.tar.gz.

File metadata

  • Download URL: ini.py-0.0.3.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for ini.py-0.0.3.tar.gz
Algorithm Hash digest
SHA256 7074eca3a1a48d74d83261cca50f4632337af05729b29726106c086754fd2ee0
MD5 332ba20e7d19aae549c57cb7a2292998
BLAKE2b-256 7bb48960fbfaffb1b5b452804ac5d56b020c0def54be35cd9cf9d5f6feacdd7c

See more details on using hashes here.

Provenance

File details

Details for the file ini.py-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: ini.py-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

File hashes

Hashes for ini.py-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0a87d489b040e3829630cd1dadc6c58867b253df5b26f9aaf6f70cc0d0fae8d9
MD5 2d3dec8aa18a51e36337671474452b43
BLAKE2b-256 e2ebe0ca8199c31fa1ac2ffc195a5f3743cea31d928a03fcb2a87539352fab26

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page