Package: prettyetc-qt
The project is divided in 2 packages:prettyetc-qt (a qt-based graphical interface for prettyetc)prettyetc (the core with the APIs)prettyetc-qtBrowse your configuration files in a visual way with a pretty and universal interface.Prettyetc allows you to edit your configs in a multitabbed window,
each config is displayed as a foldable tree that has no ugly brackets,
quotes or anything else which might be language specific.For example you can read a JSON and an INI file using the same view and structure.The official GUI is powered by the Qt framework, using the official Python bindings.prettyetcEdit configuration files with an advanced tree-based data structure and convert them to other languages.InstallationNOTE:
If you have both Python 2 and 3 installed in your system,
you probably need use pip3 instead of pip.Full installation with the UI:pip install prettyetc-qt.Or, if you want only the core:pip install prettyetc[all].The UI can be launched by executing theprettyetc-qtcommand in a terminal.
The prettyetc-qt executable must be in PATH or you need to find it to launch the UI.More informations about the installation process at:https://prettyetc.gitlab.io/prettyetc/developing/userguide/installation.htmlAn example (using the core APIs)Let’s see what prettyetc can do.fromprettyetc.etccoreimportConfigFileFactory,DictField# create the factoryfactory=ConfigFileFactory(enable_logger=True)# create the file, this can be used to read and write the filefile=factory.create_file("colors.json")# read the file and save it in a RootFieldroot=file.read()# add a new colorcolor={"color":"aqua","code":{"rgba":[0,255,255,1],"hex":"#0FF"},"web_safe":True,}root["colors"].add(DictField.from_primitives(color))# change red color namered_color=root["colors"][2]red_color["color"].data="light-red"# change red color codesred_color["code"]["rgba"][0].data=204red_color["code"]["hex"].data="#c00"# change red color web_safe fieldred_color["web_safe"].data=False# write the RootField to file (beautified json)file.write(root,language="json",beautify=True)Seegetting startedfor a quick start on how to use prettyetc.Supported languagesDue to languages nature or the used backend,
the parsers/serializers do not implement all field specifications,
but a subset of those.JSON (json)INI (configparser)XML (XML ElementTree)YAML (*ruamel.yaml)A self-defined language called etc,
seebelow(Embedded code + *lark-parser)Here is a detailed table explaining what feature are supported by language.Language- TypeJSONParserJSONSerializerINIParserINISerializerXMLParserXMLSerializerYAMLParserYAMLSerializerEtc1ParserEtc1SerializerFieldnameV2V2VVVVV2V2VVFielddescription(comment)IIVVFieldreadonlyIIVVFieldattributesIIVVIndexablefieldsVVV3V3VVVVTypedfieldVVE4E4PPVVVV* backend require external librariesLegend:empty space: not supported yetI: impossible due to language specificationE: enforced supportP: partially supportedV: fully  supported1: the etc language is divided into some sublanguages,
so some feature can be unavailable in a specific sublanguage.2: For arrays, the name can be setted to None or to an integer index.3: limited to one level.4: The INI specification does not support typing,
so any key and value is a string.DocsFor a detailed explanation of core features, Prettyetc’s Field meaning,
API reference and other, we suggest to go to the documentation of Prettyetc.API Documentation:https://prettyetc.gitlab.io/prettyetc/index.htmlAn explanation of the etc languageThe etc configuration language is a collection of micro-languages,
all of them are structured similar to INI files (without sections).The origin of this name is the *nix /etc folder that contain the system
or default configuration for lots of programs and also kernel settings.Except for files specifically formatted in INI or JSON,
the files in this folder has an undefined and a simple syntax;
made by spaces, the “:” character or the “=” character (somewhere)
and the “#” character as comment start, that remember the sh/bash syntax.Examples of these files are:/etc/resolv.conf /etc/sysctl.conf /etc/modules.Our parser aim to handle most of it, representing it using fields
in a universal view.