Dig - fetch/query in live objects

This module if for reading values from live objects. The general idea is that you use a function kingston.dig.dig() with an object and a string. The string is (somewhat) inspired by a CSS selector. It specifies how to get a certain sub-element.

The goal is that these spec-strings should be storable for future re-use.

This module is a work in progress module and thus subject to change.

High-level functions

kingston.dig.dig(obj: Any, path: str) → Any[source]

Dig after object content from object content based on a string spec.

Parameters:
  • obj – A live object that values should be digged from.
  • path – String representation of the ”path”
kingston.dig.xget(obj: Any, idx: Any) → Any[source]

Single point of entry function to fetch a value / attribute / element from an object.

Parameters:
  • obj – The object to find attribute / value in.
  • idx – Symbolic index.