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.5.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ini.py-0.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 8a7af81a9caa32c5c68d9f4b8624f5011bdd8e183af3844501325f5c2d2983bd
MD5 52bbe8b9700055a6d5e8951fb94bc708
BLAKE2b-256 e387fd8988b8266c22df91396df1ffab3efcc200cee7533b1e1ae2297ee8bb04

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: ini.py-0.0.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 cba282c5cf500c1e2c645763dcb42870711c825366a85ee2b9075b77ec725ce4
MD5 1da70c2af800f72b00e0c91e44119a33
BLAKE2b-256 755a52e3b67e01c3375cdc693e9c592209dc716569f9050480f9b1ec3f773ca9

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