Skip to main content

JSON and YAML parsing with imports.

Project description

**Installation**::

pip install importconfig

The special thing about ImportConfig is that it supports a notion
of "imports". You can import other json files in your json file
by specifying a "@file" value at any level in the config and it will
be expanded into that level.

A config file can be loaded lazily and the main config file will only be
loaded once it is called.

**Note:** keys/values defined in the top level document will take precedence
over those loaded in sub-documents.

**Example**::

{
"app_name": "foo",
"logging": {
"@file": "logging.json",
"level": "debug"
}
}

**will translate into**::

{
"app_name": "foo",
"logging": {
"log_file": "/var/log/foo.log",
"level": "debug"
}
}

**Contents of "logging.json"**::

{
"log_file": "/var/log/foo.log",
"level": "info"
}

.. todo::

✓ Support relative paths for ``@file's`` value
✓ Root document take precedence if the same key exists in the imported file

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

ImportConfig-0.0.4.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file ImportConfig-0.0.4.tar.gz.

File metadata

File hashes

Hashes for ImportConfig-0.0.4.tar.gz
Algorithm Hash digest
SHA256 71bc67606f078cc88a6db7cb8ca41b4110a173cbb835819021fa6e45bb4c7b9f
MD5 4d28ac551dcb54037b23bdf3a385ef91
BLAKE2b-256 8f9b89bdbcf85263a4b26f762fd17b65a24dfed8788fa24d58ea5f030eae6ba3

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