IDD Object Module Documentation¶
- class pyiddidf.idd_objects.IDDField(an_index: str)
Bases:
object
A simple class that defines a single field for an IDD object. Relevant members are listed here:
- Variables
field_an_index (str) – Main identifier for this field
meta_data (dict(str,[str])) – A dictionary, where each key is a string metadata type, such as “note”, and each value is a list of strings for each entry in the metadata of the key type. So if the field has 3 note lines, the dictionary value for key “note” would be a 3 element list, holding the 3 note lines.
field_name (str) – A convenience variable holding the field name, if it is found in the metadata
Constructor parameters:
- Parameters
an_index (str) – The A_i or N_i descriptor for this field in the IDD, where i is an integer 1-…
- class pyiddidf.idd_objects.IDDGroup(name: str)
Bases:
object
A simple class that defines a single IDD group. An IDD group is simply a container for IDD objects. Relevant members are listed here:
- Variables
name (str) – IDD Type, or name, of this group
objects (list(IDDObject)) – A list of all objects found in the IDD within this group.
Constructor parameters:
- Parameters
name (str) – The group’s name
- class pyiddidf.idd_objects.IDDObject(name: str)
Bases:
object
A simple class that defines a single IDD object. Relevant members are listed here:
- Variables
name (str) – IDD Type, or name, of this object
meta_data (dict(str,[str])) – A dictionary, where each key is a string metadata type, such as “memo”, and each value is a list of strings for each entry in the metadata of the key type. So if the object has 3 memo lines, the dictionary value for key “memo” would be a 3 element list, holding the 3 memo lines.
fields (list(IDDField)) – A list of IDDField instances in order as read from the IDD
Constructor parameters:
- Parameters
name (str) – The object’s type, or name
- class pyiddidf.idd_objects.IDDStructure(file_path: str)
Bases:
object
An IDD structure representation. This includes containing all the IDD objects (either inside groups or as standalone “single line objects”), as well as meta data such as the version ID for this IDD, and finally providing worker functions for accessing the IDD data
Relevant “public” members are listed here:
- Variables
file_path (str) – The path given when instantiating this IDD, not necessarily an actual path
version_float (float) – The floating point representation of the version of this IDD (for 8.6.0 it is 8.6)
build_string (str) – The abbreviated git SHA used when generating this IDD
single_line_objects ([str]) – A list of strings, each representing a raw, single-token, name-only IDD object
groups (list(IDDGroup)) – A list of all groups found in the IDD, each of which will contain IDD objects
Constructor parameters:
- Parameters
file_path (str) – A file path for this IDD; not necessarily a valid path as it is never used, just available for bookkeeping purposes.
- get_object_by_type(type_to_get)
Given a type name, this returns the IDD object instance, or a single string if it is a single-line object
- Parameters
type_to_get – The name of the object to get, case-insensitive as it is compared insensitively inside
- Returns
If the object is a single-line object, simply the name; if the object is a full IDDObject instance, that instance is returned. If a match is not found, this returns None.
- get_objects_with_meta_data(meta_data)
Given an object-level metadata string (required-object, e.g.), this returns objects that contain that metadata
- Parameters
meta_data – An object-level metadata string, such as required-object
- Returns
A list of IDDObjects that contain this metadata