Skip to main content

Load nested JSON files into a dictionary

Project description

pyModularJSON

Allows recursive loading of JSON files.

Authored by Edwin Peters

Install

setup.py install

Usage

base.json:

// comments
{
    "param2a": 2,
    "nestedParam2a":{
	"a": "notaNumber",
	"c": "set by base"
    }
}

main.json:

// comments
{
    "configBase": ["base.json"], // parent config file name relative to this file
    "param1": 4,
    "nestedParam1":{
	"a":39,
	"b":["peee","e","new"],
	"c": "set by main"
    } 
}

In Python:

from pyLoadModularJson import loadModularJson

cfg = loadModularJson('base.json')

print(cfg)

Child files will overwrite attributes from base files.

See more examples in tests

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

pyLoadModularJson-0.9.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

pyLoadModularJson-0.9.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file pyLoadModularJson-0.9.0.tar.gz.

File metadata

  • Download URL: pyLoadModularJson-0.9.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for pyLoadModularJson-0.9.0.tar.gz
Algorithm Hash digest
SHA256 742063587f70a81389b7418f12839acb2ff5572c6fce46522ada486b0fe6b032
MD5 12c59de893e941380fe2894f23a405ec
BLAKE2b-256 18e5847a95a022013800e2358ccd2f213de6c39494c750e6fbf9796e699b5ada

See more details on using hashes here.

File details

Details for the file pyLoadModularJson-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: pyLoadModularJson-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for pyLoadModularJson-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc8d125e9dc947e839a12d11eee0d02ffbe3d33b074e3492268eb194c081d5d1
MD5 d3fe7222118f1b70801097b9b2ded807
BLAKE2b-256 191670351ec9ec5ce78a00e238c62f8db8663034fc4134e7002b3c9e4abf3594

See more details on using hashes here.

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