Skip to main content

Load and merge nested configurations.

Usage

Installation:

python -m pip install overdub

With these structures:

from overdub import MutableOverdub

a = {'foo': 1, 'bar': {'baz': 2}, 'qux': {'one': 1}}
b = {'foo': 3, 'bar': {'baz': 4}, 'qux': {'two': 2}}

Update:

overdubbed = MutableOverdub(a)
overdubbed.update(b)
assert overdubbed.foo == 3
assert overdubbed.bar.baz == 4
assert overdubbed.qux == {'two': 2}

Merge:

overdubbed = MutableOverdub(a)
overdubbed.merge(b)
assert overdubbed.foo == 3
assert overdubbed.bar.baz == 4
assert overdubbed.qux == {'one': 1, 'two': 2}

Rebase:

overdubbed = MutableOverdub(a)
overdubbed.rebase(b)
assert overdubbed.foo == 1
assert overdubbed.bar.baz == 2
assert overdubbed.qux == {'one': 1, 'two': 2}

Unbound the data:

overdubbed = MutableOverdub(a)
assert isinstance(overdubbed, Overdub)
naked = MutableOverdub(a)
assert not isinstance(naked, Overdub)

Freeze configuration:

overdubbed = overdubbed.frozen()

YAML files

It can also read configuration from yaml files, for this install:

python -m pip install overdub[yaml]

And then, merge all files:

from overdub import yaml

overdubbed = yaml.load_from_file('a.yml', b.yml')
assert overdubbed.foo == 3
assert overdubbed.bar.baz == 4
assert overdubbed.qux == {'one': 1, 'two': 2}

Metadata

Release files for overdub 0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for overdub 0.7
File Size Uploaded
overdub-0.7.tar.gz 18.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for overdub 0.7
File Interpreter ABI Platform
overdub-0.7-py2-none-any.whl Python 2 none any Details

Total release size: 27.1 kB

Release files / overdub-0.7.tar.gz

Download URL overdub-0.7.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d1a660afc71d408312b0b06932c9c9c6285bec86f48a17b68e1bf1dee395c9c7
BLAKE2b-256 checksum
How to use checksums
71c19f0765f666143bede020394c784a74dd41d5a8352a8f896d6ee1d1f1c3f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / overdub-0.7-py2-none-any.whl

Download URL overdub-0.7-py2-none-any.whl
Size 8.9 kB
Tags Python 2
SHA-256 checksum
How to use checksums
b229fc927b4e5341231ef347d183a0820173e367e6ec859f04c2c9157795f48c
BLAKE2b-256 checksum
How to use checksums
04c92b2911524b24df5f9037c22809608ddaac08b715179d69dd88452708cac5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.7 This release

2 release files

0.6

2 release files

0.2

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page