jgdv.structs.dkey.keys

Classes

IndirectDKey

A Key for getting a redirected key.

MultiDKey

Multi keys allow 1+ explicit subkeys.

NonDKey

Just a string, not a key.

SingleDKey

A Single key with no extras.

Module Contents

class jgdv.structs.dkey.keys.IndirectDKey(
*,
multi=False,
re_mark=None,
**kwargs,
)[source]

Bases: jgdv.structs.dkey.dkey.DKey

A Key for getting a redirected key. eg: RedirectionDKey(key) -> SingleDKey(value)

re_mark :

Parameters:
  • multi (bool)

  • re_mark (jgdv.Maybe[jgdv.structs.dkey._interface.KeyMark])

_indirect() <Unknown>[source]
Return type:

Literal[True]

exp_generate_chains_h(
root,
factory,
opts,
) <Unknown>[source]

Lookup the indirect version, the direct version, then use the fallback

Parameters:
Return type:

list[jgdv.structs.dkey._util._interface.ExpInstChain_d | jgdv.structs.dkey._util._interface.ExpInst_d]

multi_redir = False
re_mark = None
class jgdv.structs.dkey.keys.MultiDKey(*args, **kwargs)[source]

Bases: jgdv.structs.dkey.dkey.DKey

Multi keys allow 1+ explicit subkeys.

They have additional fields:

_subkeys : parsed information about explicit subkeys

_multi() <Unknown>[source]
Return type:

Literal[True]

exp_flatten_h(vals, factory, opts) <Unknown>[source]

Flatten the multi-key expansion into a single string, by using the anon-format str

Parameters:
Return type:

jgdv.Maybe[jgdv.structs.dkey._util._interface.ExpInst_d]

exp_generate_chains_h(
root,
factory,
opts,
) <Unknown>[source]

Lift subkeys to expansion instructions

Parameters:
Return type:

list[jgdv.structs.dkey._util._interface.ExpInstChain_d | jgdv.structs.dkey._util._interface.ExpInst_d]

keys() <Unknown>[source]
Return type:

list[jgdv.structs.dkey.dkey.DKey]

anon: str
class jgdv.structs.dkey.keys.NonDKey(*args, **kwargs)[source]

Bases: jgdv.structs.dkey.dkey.DKey

Just a string, not a key.

But this lets you call no-ops for key specific methods.
It can coerce itself though
_nonkey() <Unknown>[source]
Return type:

Literal[True]

expand(*args, **kwargs) <Unknown>[source]

A Non-key just needs to be coerced into the correct str format

Return type:

jgdv.Maybe

class jgdv.structs.dkey.keys.SingleDKey(*args, **kwargs)[source]

Bases: jgdv.structs.dkey.dkey.DKey

A Single key with no extras. ie: {x}. not {x}{y}, or {x}.blah.

_post_process_h(data=None) <Unknown>[source]
Parameters:

data (jgdv.Maybe[dict])

Return type:

None