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
Built Distribution
File details
Details for the file vpd-0.9.12.tar.gz
.
File metadata
- Download URL: vpd-0.9.12.tar.gz
- Upload date:
- Size: 27.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7af31aa0e23987db16f475b992b586d1b0ae79c567a7edd0046c36ae15b858f7 |
|
MD5 | db506922b16828dc5b6e9a1d6c09a885 |
|
BLAKE2b-256 | ad7ee3847f5ee19776f90998c48bbc468a00a00842493273aa9453a0adce5c0c |
File details
Details for the file vpd-0.9.12-py3-none-any.whl
.
File metadata
- Download URL: vpd-0.9.12-py3-none-any.whl
- Upload date:
- Size: 33.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 772da24e501883460b7e0b63451f7e3dd656af26ceadaebd553cf65088fa9146 |
|
MD5 | ad722d1097f711c54cc03cad86097959 |
|
BLAKE2b-256 | 3c76cab57d9a1a80043bf9505292e0e0152f16c9d79f3b127060f2420bd4ed83 |