spydrnet.get_definitions

spydrnet.get_definitions(obj, ...)[source]

Get definitions within an object.

Parameters:
  • obj (object, Iterable - required) – The object or objects associated with this query. Queries return a collection objects associated with the provided object or objects that match the query criteria. For example, sdn.get_definitions(library, …) would return all of the definitions associated with the provided library that match the additional criteria.

  • patterns (str, Iterable - optional, positional or named, default: wildcard) – The search patterns. Patterns can be a single string or an Iterable collection of strings. Patterns can be absolute or they can contain wildcards or regular expressions. If patterns is not provided, then it defaults to a wildcard. Patterns are queried against the object property value stored under a specified key. Fast lookups are only attempted on absolute patterns that are not regular expressions and contain no wildcards.

  • key (str, optional, default: “.NAME”) – This is the key that controls which value is being searched.

  • is_case (bool - optional, named, default: True) – Specify if patterns should be treated as case sensitive. Only applies to patterns. Does not alter fast lookup behavior (if namespace policy uses case insensitive indexing, this parameter will not prevent a fast lookup from returning a matching object even if the case is not an exact match).

  • is_re (bool - optional, named, default: False) – Specify if patterns are regular expressions. If False, a pattern can still contain * and ? wildcards. A * matches zero or more characters. A ? matches upto a single character.

  • recursive (bool - optional, default: False) – Specify if search should be recursive or not meaning that sub hierarchical instances within an instance are included or not.

  • selection (Selection.{INSIDE, OUTSIDE}, default: INSIDE) – This parameter determines the instances that are returned based on the definition that is being searched. This parameter only applies to objects that are definitions. If the selection is “INSIDE” (default), then the function will return all of the instances that are inside the definition (i.e., the definition’s children) that match the remainder of the search criteria. If the selection is “OUTSIDE”, then the function will return all of the instances of the provided definition that match the remainder of the search criteria.

  • filter (function) – This is a single input function that can be used to filter out unwanted virtual instances. If not specifed, all matching virtual instances are returned. Otherwise, virtual instances that cause the filter function to evaluate to true are the only items returned.

Returns:

definitions – The definitions associated with a particular object or collection of objects.

Return type:

generator