SOTP project is a simple tool for reading and writing
config files. It allows to read as well as modify existing config
files and also to create new ones.
The SOTP project is written in Python and platform independent.
Due to the fact, that the project is intended for shell and scripting purposes, it does not come with a graphical user interface.
The main purpose of SOTP is to simplify reading and writing config files with shell scripts. It parses INI-like config files and returns a requested value as a string, but is also able to modify existing (add or delete sections as well as options and change values) or create new files.
Its core module can be easily added to other projects and used
for their config file operations.
The reader parses a config file and returns the value of a requested option from that file.
The writer modifies existing or creates new config files.
Python framework (either of them, further information can be found here)
Python 2.x (version 2.7 or higher is recommended, may also work with earlier versions)
Python 3.x (version 3.2 or higher is recommended, may also work with earlier versions)
The following usage example shows how to execute the Python script on the shell of a Unix-like system.
If you do not know, how to run Python scripts on your operating system, you may click here.
The project also comes with some help files which contain fundamental documentation as well as usage examples for each component of the project.
Usually, each script requires command-line arguments to operate. So, to get an overview of all arguments available, simply run the script with the --help argument. For example:
$ ./sotp-reader.py --help
usage: sotp-reader.py -c CONFIG_FILE -o OPTION -s SECTION [-f FALLBACK] [-h]
Parse a config file and return the value of a requested option.
-c CONFIG_FILE, --config-file CONFIG_FILE
config file to parse
-o OPTION, --option OPTION
option to read out
-s SECTION, --section SECTION
section that contains the option
-f FALLBACK, --fallback FALLBACK
value to return in case the given section or option
does not exist
-h, --help print this help message and exit
--version print the version number and exit
Further information and usage examples can be found inside the documentation
file for this script.
Downloads and further information can be found on GitHub.