Skip to main content

Python config manager using JSON

Project description

========================== Python JSON Config Manager

Usage

config.json

.. code-block:: json

{
    "database": {
        "password": "pass123", 
        "user": "root", 
        "name": "myDB", 
        "tables": {
            "comments": "nan", 
            "likes": "fuck it", 
            "users": "empty"
        }
        "keys": [
            "name",
            "id",
            "hash"
        ],
    }, 
    "server": {
        "port": 4444, 
        "host": "127.0.0.1"
    }
}

test.py

.. code-block:: python

from Jconfig.config import Jconfig

conf = Jconfig('./config.json', separator='.')

PORT = conf.get('server.port')
print(PORT) # 4444

conf.set('database.tables.likes', 'hi bitch')

conf.set('database.keys', ['md5', 'password', 'another'])

conf.set('database.keys.2', 'hoho')

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

Jconfig-1.0.tar.gz (2.1 kB view hashes)

Uploaded Source

Built Distribution

Jconfig-1.0-py3-none-any.whl (2.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page