All Projects → Eugeny → Reconfigure

Eugeny / Reconfigure

Config-file-to-Python mapping library (ORM).

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Reconfigure

Poco
The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.
Stars: ✭ 5,762 (+4136.76%)
Mutual labels:  json, configuration
Config Rs
⚙️ Layered configuration system for Rust applications (with strong support for 12-factor applications).
Stars: ✭ 915 (+572.79%)
Mutual labels:  json, configuration
Ini Parser
Read/Write an INI file the easy way!
Stars: ✭ 643 (+372.79%)
Mutual labels:  ini, configuration
Jk
Configuration as Code with ECMAScript
Stars: ✭ 322 (+136.76%)
Mutual labels:  json, configuration
Resticprofile
Configuration profiles for restic backup
Stars: ✭ 48 (-64.71%)
Mutual labels:  json, configuration
Jsonnet
Jsonnet - The data templating language
Stars: ✭ 5,257 (+3765.44%)
Mutual labels:  json, configuration
Dasel
Query, update and convert data structures from the command line. Comparable to jq/yq but supports JSON, TOML, YAML, XML and CSV with zero runtime dependencies.
Stars: ✭ 759 (+458.09%)
Mutual labels:  json, configuration
Config
JSON or YAML configuration wrapper with convenient access methods.
Stars: ✭ 237 (+74.26%)
Mutual labels:  json, configuration
Ansible Config encoder filters
Ansible role used to deliver the Config Encoder Filters.
Stars: ✭ 48 (-64.71%)
Mutual labels:  json, ini
Docker Volume Netshare
Docker NFS, AWS EFS, Ceph & Samba/CIFS Volume Plugin
Stars: ✭ 1,000 (+635.29%)
Mutual labels:  nfs, samba
config-parser
A slim, fully managed C# library for reading/writing .ini, .conf, .cfg etc configuration files.
Stars: ✭ 67 (-50.74%)
Mutual labels:  configuration, ini
Night Config
Powerful java configuration library for toml, yaml, hocon, json and in-memory configurations
Stars: ✭ 93 (-31.62%)
Mutual labels:  json, configuration
parse it
A python library for parsing multiple types of config files, envvars & command line arguments that takes the headache out of setting app configurations.
Stars: ✭ 86 (-36.76%)
Mutual labels:  configuration, ini
Goconfig
Package goconfig is a fully functional and comments-support configuration file (.ini) parser.
Stars: ✭ 568 (+317.65%)
Mutual labels:  ini, configuration
libconfini
Yet another INI parser
Stars: ✭ 106 (-22.06%)
Mutual labels:  configuration, ini
Structured Text Tools
A list of command line tools for manipulating structured text data
Stars: ✭ 6,180 (+4444.12%)
Mutual labels:  json, ini
Config
📝 Go config manage(load,get,set). support JSON, YAML, TOML, INI, HCL, ENV and Flags. Multi file load, data override merge, parse ENV var. Go应用配置加载管理,支持多种格式,多文件加载,远程文件加载,支持数据合并,解析环境变量名
Stars: ✭ 225 (+65.44%)
Mutual labels:  json, ini
Konf
A type-safe cascading configuration library for Kotlin/Java/Android, supporting most configuration formats
Stars: ✭ 225 (+65.44%)
Mutual labels:  json, configuration
Configr
Implements the JSON, INI, YAML and TOML parser, for R setting and writing of configuration file.
Stars: ✭ 38 (-72.06%)
Mutual labels:  json, ini
Tanka
Flexible, reusable and concise configuration for Kubernetes
Stars: ✭ 1,299 (+855.15%)
Mutual labels:  json, configuration

==================================================== Reconfigure - Python object mapping for config files

.. image:: https://travis-ci.org/Eugeny/reconfigure.png

Browse API on SourceGraph <https://sourcegraph.com/github.com/Eugeny/reconfigure/tree>_


Quickstart

::

>>> from reconfigure.configs import FSTabConfig 
>>> from reconfigure.items.fstab import FilesystemData
>>> 
>>> config = FSTabConfig(path='/etc/fstab')
>>> config.load()
>>> print config.tree
{
    "filesystems": [
        {
            "passno": "0", 
            "device": "proc", 
            "mountpoint": "/proc", 
            "freq": "0", 
            "type": "proc", 
            "options": "nodev,noexec,nosuid"
        }, 
        {
            "passno": "1", 
            "device": "UUID=dfccef1e-d46c-45b8-969d-51391898c55e", 
            "mountpoint": "/", 
            "freq": "0", 
            "type": "ext4", 
            "options": "errors=remount-ro"
        }
    ]
}
>>> tmpfs = FilesystemData()
>>> tmpfs.mountpoint = '/srv/cache'
>>> tmpfs.type = 'tmpfs'
>>> tmpfs.device = 'none'
>>> config.tree.filesystems.append(tmpfs)
>>> config.save()
>>> quit()
$ cat /etc/fstab
proc    /proc   proc    nodev,noexec,nosuid     0       0
UUID=dfccef1e-d46c-45b8-969d-51391898c55e / ext4 errors=remount-ro 0 1
none    /srv/cache      tmpfs   none    0       0

This is actually a shortcut to::

>>> from reconfigure.parsers import SSVParser
>>> from reconfigure.builders import BoundBuilder
>>> from reconfigure.items.fstab import FSTabData
>>> content = open('/etc/fstab').read()
>>> syntax_tree = SSVParser().parse(content)
>>> syntax_tree
<reconfigure.nodes.RootNode object at 0x7f1319eeec50>
>>> print syntax_tree
(None)
        (line)
                (token)
                        value = proc
                (token)
                        value = /proc
                (token)
                        value = proc
                (token)
                        value = nodev,noexec,nosuid
                (token)
                        value = 0
                (token)
                        value = 0
        (line)
                (token)
                        value = UUID=83810b56-ef4b-44de-85c8-58dc589aef48
                (token)
                        value = /
                (token)
                        value = ext4
                (token)
                        value = errors=remount-ro
                (token)
                        value = 0
                (token)
                        value = 1

>>> builder = BoundBuilder(FSTabData)
>>> data_tree = builder.build(syntax_tree)
>>> print data_tree
{
    "filesystems": [
        {
            "passno": "0", 
            "device": "proc", 
            "mountpoint": "/proc", 
            "freq": "0", 
            "type": "proc", 
            "options": "nodev,noexec,nosuid"
        }, 
        {
            "passno": "1", 
            "device": "UUID=83810b56-ef4b-44de-85c8-58dc589aef48", 
            "mountpoint": "/", 
            "freq": "0", 
            "type": "ext4", 
            "options": "errors=remount-ro"
        }
    ]
}

Parsers and builders can be paired in almost any possible combination.

Reconfigure can be easily extended with your own parsers and builders - read the docs!

Supported configs:

  • Ajenti (ajenti)
  • BIND9 DNS (bind9)
  • Crontabs (crontab)
  • Samba CTDB (ctdb)
  • ISC DHCPD / uDHCPD (dhcpd)
  • NFS /etc/exports (exports)
  • /etc/fstab (fstab)
  • /etc/group (group)
  • /etc/hosts (hosts)
  • iptables-save dump (iptables)
  • Netatalk afp.conf (netatalk)
  • NSD DNS (nsd)
  • /etc/passwd (passwd)
  • /etc/resolv.conf (resolv)
  • Samba (samba)
  • Squid 3 (squid)
  • Supervisord (supervisor)

Included parsers:

  • BIND9 config (bind9)
  • Crontab (crontab)
  • NFS Exports (exports)
  • .ini (ini)
  • iptables-save (iptables)
  • nginx-like (nginx)
  • squid (squid)
  • nsd (nsd)
  • CSV-like space-separated values (ssv)
  • JSON (jsonparser)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].