Skip to main content

VirtualPathDictChains. Hierarchical, Addressable Dicts, potentially using YaML

Project description

python-vpd

VirtualPathDictChains - Hierarchical Settings Management using YaML

This is an amalgamation of existing code that has been separated into its own package.

Hosted on GitHub: https://github.com/dbotwinick/python-vpd

As of version 0.9.5+, python 2.7 support is being phased out and targeting 3.9+ for python support. The legacy code is actually still python 2.7 compatible; however, the vpd.next code is not guaranteed to support python versions less than 3.9.

The base legacy code for VirtualPathDictChains is still useful and provides a mechanism to find data in "chains" of yaml. For example, if you had a dict: "{"test": {"v1": "v1", "v2":"v2"}}", using the VPD/VirtualPathDictChain approach, you could query for "test/v1" and get the result "v1". This was originally designed for complex settings or preferences management in python applications.

The "chain" part is that if a value is not found, the next source/VirtualPathDict would be searched. By having a chain, settings could be "merged" into a single queryable view. String values in the dicts also supported default arg substitution such that if a query result contained a text value of "{test/v2}", the bracketed expression would be used as a lookup to find that value--allowing references--which is also really useful for managing complex settings or preferences for an application etc.

The legacy code is maintained at vpd.legacy and backwards-compatible stubs are provided in the package root. Therefore, the following packages still work:

  • vpd.arguments
  • vpd.cid
  • vpd.cmp
  • vpd.iterable
  • vpd.yaml_dict

The newer generation code expands on this base concept to allow modeling arbitrary relationships among data "types" (expected to be yaml or yaml-like) to be able to create novel use-cases. So the next generation mechanism can also be used to model settings and use references to share settings/preferences. It's basically something like a simple, non-indexed, in-memory graph database for modeling relationships that do not require much complexity such that a real graph solution is warranted; however, the problem at hand benefits from describing relationships first and then lazily calculating some result following along the data relationships.

This newer code is in "vpd.next.graph".

As an additional utility basis, vpd.next.k8s provides utility mechanisms for Kubernetes. These are meant to ease tasks managing state (via ConfigMaps) and secrets for python applications. These can be combined with the legacy VirtualPathDict mechanisms as well as the vpd.next.graph mechanisms as part of maintaining complex applications intended to operate in a Kubernetes context. Note that the official Kubernetes python client is required for Kubernetes functionality.

More documentation to come...

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

vpd-0.9.13.tar.gz (28.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vpd-0.9.13-py3-none-any.whl (33.6 kB view details)

Uploaded Python 3

File details

Details for the file vpd-0.9.13.tar.gz.

File metadata

  • Download URL: vpd-0.9.13.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for vpd-0.9.13.tar.gz
Algorithm Hash digest
SHA256 1bd6a81194d7cd4ebfeff5899c57d98447adcf27d4ec5597ac6ca240135f6151
MD5 6e50760969fa317ea14f7a444d50f005
BLAKE2b-256 fecf415c76d473bc09f8dd707c9fe94338078e48f683caba1f1583f1b471c709

See more details on using hashes here.

File details

Details for the file vpd-0.9.13-py3-none-any.whl.

File metadata

  • Download URL: vpd-0.9.13-py3-none-any.whl
  • Upload date:
  • Size: 33.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for vpd-0.9.13-py3-none-any.whl
Algorithm Hash digest
SHA256 a6b6f69f34104edc4692603474a6941317410d03aa6e3b999658cedc2856b517
MD5 18a63dc9113fdd621958918c5f084f7f
BLAKE2b-256 4995b9dbd4e62f2f49b415f63673a45c5bf16fd0c338490632e8f815646614bb

See more details on using hashes here.

Supported by

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