dpmcore.services.explorer

Reverse lookups over the DPM dictionary: resolve a variable by code, find where a variable is used, and search for tables. Release-aware.

ExplorerService

class dpmcore.services.explorer.ExplorerService(session)[source]

Bases: object

Introspection / reverse-lookup queries on the DPM model.

Parameters:

session (Session) – An open SQLAlchemy session.

__init__(session)[source]

Build the service bound to session.

Parameters:

session (Session)

Return type:

None

get_variable_by_code(variable_code, release_id=None, release_code=None)[source]

Look up a variable by its code.

Return type:

Optional[Dict[str, Any]]

Parameters:
  • variable_code (str)

  • release_id (int | None)

  • release_code (str | None)

get_variable_usage(variable_vid, release_id=None, release_code=None)[source]

Find all operations that reference variable_vid.

Return type:

List[Dict[str, Any]]

Parameters:
  • variable_vid (int)

  • release_id (int | None)

  • release_code (str | None)

search_table(query, release_id=None, release_code=None)[source]

Search tables by code (partial match).

Return type:

List[Dict[str, Any]]

Parameters:
  • query (str)

  • release_id (int | None)

  • release_code (str | None)