Skip to main content

Json-based configuration parser, similar to configparser

Project description

JSON config parser

Json-based configuration parser, similar to configparser

Install

pip install jsondbparser

Use

from jsondbparser import core as parser

db = parser.parser('file.txt', encoding = 'utf-8', debug = False)

db.add_section('section')
# adds section

db.set('section', 'name', 'value')
# changes or adds value

db.get('section', 'name')
# returns 'value'

db.get_section('section')
# returns json section

db['section']['name']
# returns 'value'

db['section']['name'] = 'test'
# returns 'test'

db.save()
# save db to file, return relative path


from jsondbparser import convert

convert.from_path('file.txt', str = False)
# convert config file to json, return json

import ConfigParser

config = ConfigParser.ConfigParser()
config.read('file.txt')

convert.from_config(config, str = False)
# convert config to json, return json

Project details


Download files

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

Files for jsondbparser, version 2.2
Filename, size File type Python version Upload date Hashes
Filename, size jsondbparser-2.2-py3-none-any.whl (3.6 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size jsondbparser-2.2.tar.gz (2.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page