You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

trabConfig

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trabConfig

A simple config parser that supports JSON and YAML

0.1.5
pipPyPI
Maintainers
1

trabConfig

A simple Config file parser that supports json, and yaml formats with auto-save feature.

Installation

from pip ::

pip install trabConfig

or the old fashioned way ::

python setup.py install

NOTE: wheels and source dists also available on pypi

Usage

Example -

.. code-block:: python

from trabconfig 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

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.