Skip to main content

Ansible Dot-diff Library

Nested structure diff library with dot-path notation for Ansible.

License: MIT

Description

This package is built to plug into Ansible’s module_utils, which doesn’t require it to be installed on managed remote hosts, only the controller. It will be picked up by Ansiballz, which zips a module’s dependencies and ships it over SSH. The library is kept small to keep the footprint down.

Usage

By design, the algorithm will ignore any keys that are omitted on the right (the target), to allow an API endpoint to choose plausible defaults. For example, an API client implementing this library will diff the desired state with a JSON REST resource to predict whether or not a REST call needs to occur for the user’s changes to be applied.

from ansible.module_utils.dotdiff import dotdiff

orig = { ‘one’: ‘one’,

‘two’: ‘two’ }

dest = { ‘one’: ‘another’,

‘three’: ‘three’ }

dotdiff(orig, dest)

dotdiff() yields a list of DiffEntry objects:

[one: “one” => “another”, three: “<undefined>” => “three”]

Keys that would be added to the structure in this transaction have their values marked as ‘<undefined>’.

Nested lists and dictionaries are supported at an arbitrary level and will be indicated using dot-separated paths. Changing a list’s member count will yield a DiffEntry indicating a change in cardinality with a pound (#) sign.

mylist.#: “3” => “4”

This visualization is inspired by Terraform.

License

MIT.

Metadata

Release files for ansible-dotdiff 0.1.5

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

Source distribution (sdist)

Source distribution for ansible-dotdiff 0.1.5
File Size Uploaded Provenance Actions
ansible-dotdiff-0.1.5.tar.gz 4.1 kB Without provenance Details for ansible-dotdiff-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ansible-dotdiff 0.1.5
File Interpreter ABI Platform Actions
ansible_dotdiff-0.1.5-py2.py3-none-any.whl Python 3, Python 2 none any Details for ansible_dotdiff-0.1.5-py2.py3-none-any.whl

Total release size: 8.5 kB

Release files / ansible-dotdiff-0.1.5.tar.gz

Download URL ansible-dotdiff-0.1.5.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fb78560d8d885e0fdb3d473cf9ad4e5ccb83386b70c9bf33dbd1723bc151ec3b
BLAKE2b-256 checksum
How to use checksums
71ea6f29f7db6f0137338df3a4b73816ad68fc9292a1fef95c0ee4a2b093d3ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.2

Release files / ansible_dotdiff-0.1.5-py2.py3-none-any.whl

Download URL ansible_dotdiff-0.1.5-py2.py3-none-any.whl
Size 4.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
4d48706b7d01a4cc22f808d43889290ab25f41fd131ba69e8c9af719d290dc23
BLAKE2b-256 checksum
How to use checksums
f80408e6f634e02852edb53897fddd5042b6f0fc8c63d6c7349fae5ac20bdf08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.2

Security for ansible-dotdiff 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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