All Projects → dhagrow → profig

dhagrow / profig

Licence: MIT license
A straightforward configuration library for Python.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to profig

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 (+765.38%)
Mutual labels:  config
ini
📝 Go INI config management. support multi file load, data override merge. parse ENV variable, parse variable reference. Dotenv file parse and loader. INI配置读取管理,支持多文件加载,数据覆盖合并, 解析ENV变量, 解析变量引用。DotEnv 解析加载
Stars: ✭ 72 (+176.92%)
Mutual labels:  config
DazzleConf
Incredible configuration library
Stars: ✭ 34 (+30.77%)
Mutual labels:  config
Winton.extensions.configuration.consul
Enables Consul to be used as a configuration source in dotnet core applications
Stars: ✭ 239 (+819.23%)
Mutual labels:  config
dotfiles
My NixOS configuration featuring awesome and neovim
Stars: ✭ 40 (+53.85%)
Mutual labels:  config
nvim
No description or website provided.
Stars: ✭ 13 (-50%)
Mutual labels:  config
Spring Cloud Vault
Configuration Integration with HashiCorp Vault
Stars: ✭ 210 (+707.69%)
Mutual labels:  config
nim config
Global project-agnostic config.nims
Stars: ✭ 54 (+107.69%)
Mutual labels:  config
config utilities
Utility tools to make working with config structs for (ROS) C++ libraries more uniform, readable and convenient.
Stars: ✭ 19 (-26.92%)
Mutual labels:  config
juno-agent
juno-agent
Stars: ✭ 46 (+76.92%)
Mutual labels:  config
Webpack Config
Helps to load, extend and merge webpack configs
Stars: ✭ 244 (+838.46%)
Mutual labels:  config
Yay Evil Emacs
😈 A lightweight literate Emacs config with even better "better defaults". Shipped with a custom theme!
Stars: ✭ 250 (+861.54%)
Mutual labels:  config
dotfiles
/home/yous
Stars: ✭ 43 (+65.38%)
Mutual labels:  config
Konf
A type-safe cascading configuration library for Kotlin/Java/Android, supporting most configuration formats
Stars: ✭ 225 (+765.38%)
Mutual labels:  config
rimerc
rimerc: rimer's dictionary & config
Stars: ✭ 228 (+776.92%)
Mutual labels:  config
Environ Config
Python Application Configuration With Environment Variables
Stars: ✭ 210 (+707.69%)
Mutual labels:  config
dotfiles
My personal set of dotfiles (Managed with Stow)
Stars: ✭ 34 (+30.77%)
Mutual labels:  config
dotfiles
The config that makes me a productivity whiz 🧙‍♂️
Stars: ✭ 36 (+38.46%)
Mutual labels:  config
dotfiles
My collection of dotfiles
Stars: ✭ 77 (+196.15%)
Mutual labels:  config
Webpack5-Max
Webpack 5 Boilerplate for JS/React/TS apps.
Stars: ✭ 103 (+296.15%)
Mutual labels:  config

Overview

profig is a straightforward configuration library for Python.

https://img.shields.io/azure-devops/tests/cymrow/profig/1?style=plastic

Motivation

Why another configuration library? The simple answer is that none of the available options give me everything I want, with an API that I enjoy using. This library provides a lot of powerful functionality, but never at the cost of simplicity.

Features

  • Automatic value conversion.
  • Section nesting.
  • Dict-like access.
  • Single-file module with no dependencies.
  • Extensible input/output formats.
  • Built-in support for INI files and the Windows registry.
  • Preserves ordering and comments of INI files.
  • Full Unicode support.
  • Supports Python 2.7+ and 3.2+.

Installation

profig installs using easy_install or pip:

$ pip install profig

Example

Basic usage is cake. Let's assume our config file looks like this:

[server]
host = 192.168.1.1
port = 9090

First, we specify the defaults and types to expect:

>>> cfg = profig.Config('server.cfg')
>>> cfg.init('server.host', 'localhost')
>>> cfg.init('server.port', 8080)

Then, we sync our current state with the state of the config file:

>>> cfg.sync()

As expected, we can access the updated values without undue effort, either directly:

>>> cfg['server.host']
'192.168.1.1'

Or by section. Notice that the type of the port option is preserved:

>>> server_cfg = cfg.section('server')
>>> server_cfg['port']
9090

Resources

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