A simple config parser that supports JSON and YAML
Project description
A simple Config file parser that supports json, and yaml formats with auto-save feature.
Usage
Example -
import trabConfig
# load file verbatim
config = trabConfig("config.json", autosave=False, data='json')
# or just
config = trabConfig("config.json")
# for yaml
config = trabConfig("config.yml", data='yaml)
# autosave capability (saves on changes)
config.autosave = True
# or during instantiation
config = trabConfig("config.json", autosave=True)
# usage example
health = config['health']
config['health'] = 9999
mana = config.get('mana', None)
if mana is not None:
config['mana'] = 999
lvl = config.get('lvl')
config.set('lvl', 99)
config.new('items', [])
config['items'].append('gold')
config.delete('cloth')
config.save()
Notes
Created by - traBpUkciP 2016-2017
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
trabConfig-0.1.2.tar.gz
(2.9 kB
view details)
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trabConfig-0.1.2.tar.gz.
File metadata
- Download URL: trabConfig-0.1.2.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
186818bb1dbd4b723393088a69ac2feb29d42beb64499bea4be0891abce849f5
|
|
| MD5 |
2c715f6941782c2cf11654deb24b5dab
|
|
| BLAKE2b-256 |
bf037c7d8dff1dd753ab5f4073f92945e3b35e3cc130c48beb3c8f6fdac75d5f
|
File details
Details for the file trabConfig-0.1.2-py2.py3-none-any.whl.
File metadata
- Download URL: trabConfig-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef2c9b77c38eaf5eeb3961be1f9d747c0abe6a1940a436f08d8e357cfca8e443
|
|
| MD5 |
798e26dfa8735e809733592e215371ef
|
|
| BLAKE2b-256 |
30fbb4b9caf1888a7d3239205899ebf5f0cc483e35773ba205d6d9ee95845fa6
|
File details
Details for the file trabConfig-0.1.2-py2-none-any.whl.
File metadata
- Download URL: trabConfig-0.1.2-py2-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdad3bd64a1e6b46a6fc3cd21514d8f4d51632a385173b36e6d669b77e208a84
|
|
| MD5 |
5246be418413816186a00e7c33e95ebc
|
|
| BLAKE2b-256 |
27eba3370d6d323a2bdc347c0c1105dad3ebef60a7e0bb32e263607e3e2a85e7
|