Skip to main content

See your configuration files using a pretty and universal interface.

Project description

The project is divided in 2 packages:

  • prettyetc-qt (a qt-based graphical interface for prettyetc)

  • prettyetc (the core with the APIs)

prettyetc-qt

Browse 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.

prettyetc

Edit configuration files with an advanced tree-based data structure and convert them to other languages.

Installation

NOTE: 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 the prettyetc-qt command 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.html

An example (using the core APIs)

Let’s see what prettyetc can do.

from prettyetc.etccore import ConfigFileFactory, DictField

# create the factory
factory = ConfigFileFactory(enable_logger=True)

# create the file, this can be used to read and write the file
file = factory.create_file("colors.json")

# read the file and save it in a RootField
root = file.read()

# add a new color
color = {
    "color": "aqua",
    "code": {
        "rgba": [0, 255, 255, 1],
        "hex": "#0FF"
    },
    "web_safe": True,
}
root["colors"].add(DictField.from_primitives(color))

# change red color name
red_color = root["colors"][2]
red_color["color"].data = "light-red"

# change red color codes
red_color["code"]["rgba"][0].data = 204
red_color["code"]["hex"].data = "#c00"

# change red color web_safe field
red_color["web_safe"].data = False

# write the RootField to file (beautified json)
file.write(root, language="json", beautify=True)

See getting started for a quick start on how to use prettyetc.

Supported languages

Due to languages nature or the used backend, the parsers/serializers do not implement all field specifications, but a subset of those.

Here is a detailed table explaining what feature are supported by language.
Language
- Type
JSON
Parser
JSON
Serializer
INI
Parser
INI
Serializer
XML
Parser
XML
Serializer
YAML
Parser
YAML
Serializer
Etc 1
Parser
Etc 1
Serializer
Field
name

V 2

V 2

V

V

V

V

V 2

V 2

V

V

Field
description
(comment)

I

I

V

V

Field
readonly

I

I

V

V

Field
attributes

I

I

V

V

Indexable
fields

V

V

V 3

V 3

V

V

V

V

Typed
field

V

V

E 4

E 4

P

P

V

V

V

V

* backend require external libraries

Legend:

empty space: not supported yet
I: impossible due to language specification
E: enforced support
P: partially supported
V: fully supported

1: 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.

Docs

For 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.html

An explanation of the etc language

The 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

prettyetc_qt-0.4.0-py3-none-any.whl (206.1 kB view details)

Uploaded Python 3

File details

Details for the file prettyetc_qt-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: prettyetc_qt-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 206.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.9

File hashes

Hashes for prettyetc_qt-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 82b674e4553197b3fe2feb708c8346b6a939e94d45ddb8b75489617d6713e3a9
MD5 5a6b0c22fad4b29c9c558ef6042be47c
BLAKE2b-256 04c78a8b1cd626d5a13e7e99872de31e6372cff568bc423604d870067a587583

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page