Skip to main content
A class to parse configuration files that require indexing.
This class returns a dictionary that you can call to retrieve items
from your config file.

To use this parser to its full potential create config files in the
following format for example:

(Example config file)

# Home server
server_1 = somename
ip_1 = 1.2.3.4
location_1 = san jose

# Remote server
server_2 = someothername
ip_2 = 4.3.2.1
location_2 = boston

# Universal configs
universal_key = something universal
my_username = kyle


You can keep raising the indexed number as much as you want.
The way to use this library is to pick a config definition
that you know will be different for each index. In this case I would
use "server" as the "defining key" and that would make each server name
into its own dictionary and the key/value pairs for it would be the config
key/values that are associated with the same index number.

There are 3 lists that are created on each parse:
keys = this is a list of the keys that are not indexed
(used for universal purposes)
index_keys = this is a list of all the keys that are indexed
(this is generated based on the defining key)
all_keys = this is a list of all the keys combined

Examples:

import IndexConfigParser

(The following code will print the dictionaries of each index key)
icp = IndexConfigParser.IndexConfigParser("/home/kyle/config.cfg", "server")
for key in icp.index_keys:
print "The dictionary for %s is: " %key
print icp[key]

(The following is how to call a specific key in the index key dict)
icp = IndexConfigParser.IndexConfigParser("/home/kyle/config.cfg", "server")
var = "somename"
icp[var]["ip"]
(Using the example config file above this would return "1.2.3.4")

Metadata

Release files for IndexConfigParser 1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for IndexConfigParser 1.2
File Interpreter ABI Platform Actions
IndexConfigParser-1.2.tar.gz Details for IndexConfigParser-1.2.tar.gz

Release files / IndexConfigParser-1.2.tar.gz

Download URL IndexConfigParser-1.2.tar.gz
Size 2.0 kB
Tags Source
SHA-256 checksum
How to use checksums
90cb12245e02bb0c59cfb6a01ca25058b2aed35dcbddc869984c6206b567b6b4
BLAKE2b-256 checksum
How to use checksums
b5128c08260f90f439a8d642ab599d0f4e055c9caeb2dbb2e96db0b9908e9bec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for IndexConfigParser 1.2

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.

Release history Release notifications | RSS feed

This release

1.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page