maci docs
  • maci
  • WATCH
    • Quick Start
    • Full Training Series
  • DOCS
    • maci
      • language
        • v1.0.0
      • functions
        • maci.build
        • maci.load
        • maci.loadstr
        • maci.loadattrs
        • maci.loadraw
        • maci.loaddict
        • maci.loadstrdict
        • maci.dump
        • maci.dumpstr
        • maci.dumpraw
      • object
        • methods
          • lock_attr
          • unlock_attr
          • hard_lock_attr
          • map_attr
          • unmap_attr
          • load_attrs
          • get_attrs
          • get_locked_list
          • get_hard_locked_list
          • get_all_maps
          • get_parent_maps
          • get_child_maps
          • get_parent_map_chains
          • is_parent_map
          • is_child_map
      • errors
      • hints
    • json
      • functions
        • maci.jsonload
        • maci.jsonloadstr
        • maci.jsondump
        • maci.jsondumpstr
    • yaml
      • functions
        • maci.yamlload
        • maci.yamlloadstr
        • maci.yamlloadall
        • maci.yamldump
        • maci.yamldumpstr
        • maci.yamldumpall
    • toml
      • functions
        • maci.tomlload
        • maci.tomlloadstr
        • maci.tomldump
        • maci.tomldumpstr
    • ini
      • functions
        • maci.iniload
        • maci.inidump
        • maci.inibuildauto
        • maci.inibuildmanual
    • xml
      • functions
        • maci.xmlload
        • maci.xmlloadstr
        • maci.xmlloaddict
        • maci.xmlloadstrdict
        • maci.xmldump
        • maci.xmldumpstr
        • maci.xmldumpdict
        • maci.xmldumpstrdict
        • maci.xmlbuildmanual
        • maci._defuse_xml_stdlib
    • pickle
      • functions
        • maci.pickleloadbytes
        • maci.pickledumpbytes
    • tools
      • hash functions
        • maci.createhash
        • maci.createfilehash
        • maci.comparefilehash
      • format functions
        • maci.cleanformat
  • Updates
    • Changelog
      • v1.1.0
      • v1.0.0
Powered by GitBook
On this page
  • loading a file
  • parameters & arguments
  1. DOCS
  2. ini
  3. functions

maci.iniload

loads ini data from a file

Last updated 1 year ago

loading a file

Loads ini file data, and returns a object. This function can also load ".conf" files.

maci.iniload ->

Basic Example of loading an ini file using default positional parameter

data = maci.iniload('mydata.ini')

In this example, we simply load ini data from a file using the iniload function and pass a string of the filepath to the file as an argument to the function to load the ini data, and assign the returned data to a variable.

Basic Example of accessing sections and their keys to get values

data['section']['key']

Note: All values in a ini file are , but can be converted with some of the on the object.

More information on using ConfigParser data: Youtube Video Search: Documentation:

parameters & arguments

Describes all parameter functionality and accepted data types

filename: str | Path

First and only required positional argument. Accepts strings and

Use this parameter to point to your filepath

encoding: str | None

Optional parameter. Accepts strings or None. Default = None

Use this parameter to load the data with the desired codec of the encoded data if needed. The default uses the default of python, so you don't have to use this, but you can if the data is using a specific codec.

This function uses the native configparser library shipped with the python standard library for its underlying functionality. ExtendedInterpolation is enabled by default. For more information on the configparser library, visit:

ConfigParser
ConfigParser
returned as strings
convenience methods
https://www.youtube.com/results?search_query=python+configparser
https://docs.python.org/3/library/configparser.html
Path objects
https://docs.python.org/3/library/configparser.html