ini-configuration-parser
description
An INI file is a configuration file for computer software that consists of a text-based content with a structure and syntax comprising key–value pairs for properties, and sections that organize the properties.[1] The name of these configuration files comes from the filename extension INI, for initialization, used in the MS-DOS operating system which popularized this method of software configuration. The format has become an informal standard in many contexts of configuration, but many applications on other operating systems use different file name extensions, such as conf and cfg.
Getting started
Install the package
$ pip install pyini-parser
from pyini_parser.configure.parser import ConfigParser
config = ConfigParser()
config["deployment"] = {
"domain_name": "www.example.com",
"secret_key": "!@#$#$#@!!",
}
config["database"] = {
"host": "localhost",
"port": "3306",
"user": "root",
}
config["email"] = {
"host": "smtp.gmail.com",
"port": "587",
}
config["devolvement"] = {
"api_key": "!@#$%^&*()_+",
}
string_content = """
[deployment]
domain_name=www.example.com
secret_key=!@#$#$#@!!
[devolvement]
api_key=!@#$%^&*()_+
"""
with open("example.ini", "w") as f:
config.write(f) # Check example.ini file contents
config.sections() # Return a list of sections
config.get("deployment", "domain_name") # Get the value of a key in a section
config.append('devolvement', {'password':'#%$%80@#$36415'}) # Append a new key/value pair to section 'devolvement'
config.read_from_string(string_content) # you can use this method to check if everything working well
# Uncomment the following lines to test the read method if you have a file
# config.read(f) # Read example.ini file contents | you must have file example.ini in the same directory
- Then you can test you'r file with pytest test library.
$ pytest
You should see something like this
======= 11 passed in 0.08s =======
Metadata
Release files for pyini-parser 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyini-parser-0.9.0.tar.gz | 4.1 kB | Without provenance | Details for pyini-parser-0.9.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyini_parser-0.9.0-py3-none-any.whl | Python 3 | none | any | Details for pyini_parser-0.9.0-py3-none-any.whl |
Total release size: 9.0 kB
Release files / pyini-parser-0.9.0.tar.gz
| Download URL | pyini-parser-0.9.0.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
117eccd7d6042acdb5aefbd8a136a44e634fd5c575c526d5e2709566a457001b
|
|
BLAKE2b-256 checksum How to use checksums |
616c5153b206be4970693bbf0888c9fd0bf1f98b1ecaf8a89b5f5972e0e17c52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.8.10 Linux/5.13.0-40-generic
|
Release files / pyini_parser-0.9.0-py3-none-any.whl
| Download URL | pyini_parser-0.9.0-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a0888c6d37901f745729ee631cb8e82097d596d536cce9a8414eb48fdd1be363
|
|
BLAKE2b-256 checksum How to use checksums |
d1ce8e0f24f2cf9a92129ce29692566b2aff99e7807a9975b825af059fdfd239
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.8.10 Linux/5.13.0-40-generic
|
Security for pyini-parser 0.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.