The Understand Python API gives scripts access to everything Understand knows about your code — entities, references, metrics, and dependencies — and powers custom checks, graphs, and reports.

AutomaticArchContext#

class understand.AutomaticArchContext#

Bases: object

Automatic architecture plugin object

This object is provided to an automatic architecture plugin’s build function. Use the add() method to define the architecture.

Methods Summary

add

Add an entity with the given name to this architecture.

cache

Return a cache that can be used to store, retrieve, and share data.

is_aborted

Return True if architecture generation has been aborted by the user.

map

Deprecated alias of add()

options

Return the Options object associated with this architecture.

set_progress_range

Set progress range (default 1 - 100).

set_progress_value

Report progress value.

Methods Documentation

add(ent, name='') None#

Add an entity with the given name to this architecture.

Parameters:
  • ent (understand.Ent) – the entity to add

  • name (str) – optional, forward slash separated name relative to the architecture root. If not specified, the entity is added to the root.

Return type:

None

cache(id='') understand.Cache#

Return a cache that can be used to store, retrieve, and share data. If id is not given, it will be a script-specific identifier. This function may return None if caching is not available.

Return type:

understand.Cache

Returns:

a cache object or None

is_aborted() bool#

Return True if architecture generation has been aborted by the user.

Return type:

bool

Returns:

True if architecture generation has been aborted by the user

map(ent, name) None#

Deprecated alias of add()

options() understand.Options#

Return the Options object associated with this architecture.

Return type:

understand.Options

Returns:

the Options object associated with this architecture

set_progress_range(min, max) None#

Set progress range (default 1 - 100).

Parameters:
  • min (int) – the minimum progress value

  • max (int) – the maximum progress value

Return type:

None

set_progress_value(value) None#

Report progress value.

Parameters:

value (int) – the current progress

Return type:

None