Workorder module can be used to retrieve Workorder information from AssetCentral.
Classes are provided for individual Workorders as well as groups of Workorders (WorkorderSet).
- class sailor.assetcentral.workorder.Workorder(ac_json)
AssetCentral Workorder Object.
ac_json (dict) –
- classmethod get_available_properties()
Return the available properties for this class.
- property id
Return the ID of the object.
- class sailor.assetcentral.workorder.WorkorderSet(elements)
Class representing a group of Workorders.
Return all information on the objects stored in the MasterDataEntitySet as a pandas dataframe.
columnscan be specified to select the columns (and their order) for the DataFrame.
columns (Optional[Iterable[str]]) –
Select a subset of the collection based on named filter criteria for the attributes of the elements.
All keyword arguments are concatenated as filters with OR operator, i.e., only one of the supplied filters must match for an entity to be selected.
Returns a new AssetcentralEntitySet object.
- Return type
- plot_distribution(by=None, fill=None, dropna=False)
Plot the distribution of elements of a MasterDataEntitySet based on their properties.
This effectively creates a histogram with the number of elements per group on the y-axis, and the group (given by the by parameter) on the x-axis. Additionally, the fill colour of the bar can be used to distinguish a second dimension.
- sailor.assetcentral.workorder.find_workorders(*, extended_filters=(), **kwargs)
Fetch Workorders from AssetCentral with the applied filters, return a WorkorderSet.
This method supports the usual filter criteria, i.e. - Any named keyword arguments applied as equality filters, i.e. the name of the Workorder property is checked against the value of the keyword argument. If the value of the keyword argument is an iterable (e.g. a list) then all objects matching any of the values in the iterable are returned.
- Return type
Find all Workorders with name ‘MyWorkorder’:
Find all Workorders which either have the name ‘MyWorkorder’ or the name ‘MyOtherWorkorder’:
Find all workorders with very high priority:
find_workorders(priority = 20)
If multiple named arguments are provided then all conditions have to match.
Find all workorders with very high priority (20) and has progress status ‘pending’(15)
find_workorders(priority = 20, progressStatus = 15).
extended_filtersparameter can be used to specify filters that can not be expressed as an equality. Each extended_filter needs to be provided as a string, multiple filters can be passed as a list of strings. As above, all filter criteria need to match. Extended filters can be freely combined with named arguments. Here, too all filter criteria need to match for a Workorder to be returned.
Find all Workorders with start date higher than 2020-01-01:
find_workorders(extended_filters=['start_date >= "2020-01-01"'])