riptable.rt_meta
Classes
A document object containing metadata about a data object. |
|
A hierarchically structured container of descriptive information |
|
Descriptive information for a data object. |
Functions
|
Apply a schema containing descriptive information recursively to the |
|
Return the |
|
Return the |
- class riptable.rt_meta.Doc(schema)
Bases:
riptable.rt_struct.Struct
A document object containing metadata about a data object.
- Parameters:
schema (dict) – See
apply_schema()
for more information on the format of the dictionary.
- _descrip
- _detail
- _steward
- _type
- __repr__()
Return repr(self).
- __str__()
Return str(self).
- _as_info()
- _repr_html_()
- class riptable.rt_meta.Info
A hierarchically structured container of descriptive information for a data object.
- items: List[Item] | None
For a
Struct
orDataset
, the items contained within it.- Type:
list of
Item
- __repr__()
Return repr(self).
- __str__()
Return str(self).
- _make_text()
- _repr_html_()
- class riptable.rt_meta.Item(name, type, description, steward)
Descriptive information for a data object.
- Parameters:
- riptable.rt_meta.apply_schema(obj, schema, doc=True)
Apply a schema containing descriptive information recursively to the input data object.
The schema should be in the form of a hierarchical dictionary, where for the data object, and recursively for each element it may contain, there is a descriptive dictionary with the following keys and values:
Type: ‘Struct’, ‘Dataset’, ‘Multiset’, ‘FastArray’, etc.
Description: a brief description of the data object
Steward: the name of the steward for that data object
Detail: any additional descriptive information
Contents: if the data object is a
Struct
,Dataset
, orMultiset
, a recursively formed dictionary where there is a descriptive dictionary of this form associated with the name of each element contained by the data object.
When the schema is applied to the data object, key/value pairs are set within the
_meta
dictionary attribute of the object and all of its elements, to enable subsequent retrieval of the descriptive information using thert_struct.Struct.info()
method orrt_struct.Struct.doc()
property.In addition, during the schema application process, the contents and type of each data object is compared to the expectation of the schema, with any differences returned in the form of a dictionary.
- Parameters:
obj (Struct or FastArray) – The data object to apply the schema information to.
schema (dict) – A descriptive dictionary defining the schema that should apply to the data object and any elements it may contain.
doc (bool) – Indicates whether to create and attach a
Doc
to the object, so that thedoc()
method may be run on the object.
- Returns:
res – Dictionary of deviations from the schema
- Return type:
See also