Package: sailor
Project “Sailor”Project “Sailor”allows you to easily access data from your SAP Digital Supply Chain software products for data science projects like
predictive maintenance or master data analysis.Once your data is available, it is your choice how to work with it. Project “Sailor” comes with several predefined functions to support you
in exploring your data. Adding to that you can create custom plots or even build your own machine learning models.
You can learn more about that on ourtutorial page.
“Sailor” provides you with a set of functions out of the box, but most importantly it facilitates flexibility and extensibility.RequirementsYou need access to SAP Asset Central and the SAP IoT services in order to use “Sailor”.Since the project “Sailor” is implemented in Python you need to have Python installed. Currently we support Python >=3.8.
The required python packages are automatically installed while installing “Sailor”.InstallationInstall the package with pippip install sailorConfiguration“Sailor” talks to two services: SAP Asset Central and SAP IoT.
You have two options of specifying the configuration:EnvironmentYAML fileThe above order is honoured when “Sailor” checks for the configuration.EnvironmentA JSON string can be provided with the environment variableSAILOR_CONFIG_JSON. Example:os.environ['SAILOR_CONFIG_JSON']=json.dumps({'asset_central':{'client_id':'ACexampleId','client_secret':'ACexampleSecret','application_url':'https://<system>.cfapps.<landscape>.hana.ondemand.com','access_token_url':'https://authentication.<landscape>.hana.ondemand.com/oauth/token','subdomain':'account-name'},'sap_iot':{'client_id':'IoTexampleId','client_secret':'IoTexampleSecret','extension_url':'https://iot-extension-sap-<space>.cfapps.<landscape>.hana.ondemand.com','export_url':'https://coldstore-export-sap-<space>.cfapps.<landscape>.hana.ondemand.com','download_url':'https://coldstore-downloader-sap-<space>.cfapps.<landscape>.hana.ondemand.com','access_token_url':'https://authentication.<landscape>.hana.ondemand.com/oauth/token','subdomain':'account-name'},'predictive_asset_insights':{'client_id':'PAIexampleId','client_secret':'PAIexampleSecret','application_url':https://<system>.cfapps.<landscape>.hana.ondemand.com,'access_token_url':https://authentication.<landscape>.hana.ondemand.com/oauth/token,'subdomain':'account-name',},})YAML fileSpecify the location of a YAML file via environment variable (e.g.:SAILOR_CONFIG_PATH=/home/my_sailor_config.yml). Alternatively you can put a YAML file namedconfig.ymlnext to your main script/notebook without setting theSAILOR_CONFIG_PATH. Example YAML file:asset_central:client_id:ACexampleIdclient_secret:ACexampleSecretapplication_url:https://<system>.cfapps.<landscape>.hana.ondemand.comaccess_token_url:https://authentication.<landscape>.hana.ondemand.com/oauth/tokensubdomain:account-namesap_iot:client_id:IoTexampleIdclient_secret:IoTexampleSecretextension_url:https://iot-extension-sap-<space>.cfapps.<landscape>.hana.ondemand.comexport_url:https://coldstore-export-sap-<space>.cfapps.sap.<landscape>.ondemand.comdownload_url:https://coldstore-downloader-sap-<space>.cfapps.<landscape>.hana.ondemand.comaccess_token_url:https://authentication.<landscape>.hana.ondemand.com/oauth/tokensubdomain:account-namepredictive_asset_insights:client_id:PAIexampleIdclient_secret:PAIexampleSecretapplication_url:https://<system>.cfapps.<landscape>.hana.ondemand.comaccess_token_url:https://authentication.<landscape>.hana.ondemand.com/oauth/tokensubdomain:account-nameQuickstart ExampleThe following code snippet can be used to quickly get started with “Sailor”. It shows you how to read data of equipments, notifications and sensor data from your SAP backends. In addition to that there are predefined plotting functions which can be used to explore your data.For a detailed example please visit ourtutorial page. It will walk you through the functionality offered by project “Sailor” step by step.importpandasaspdfromsailor.assetcentralimportfind_equipment,find_notifications# find equipments and plot themequipment_set=find_equipment(model_name='my_model_name')equipment_set.plot_distribution('location_name')# get sensor data from equipmenttimeseries_data=equipment_set.get_indicator_data('2020-10-01 00:00:00+00:00','2021-01-01 00:00:00+00:00')# find notifications and plot themnotification_set=equipment_set.find_notifications(extended_filters=['malfunction_start_date > "2020-08-01"'])notification_set.plot_overview()LimitationsCurrently we do not support parallel data processing frameworks.
You are bound by the limitations of the pandas DataFrame and the computing hardware running our code.Known IssuesThere are currently no known issues. All upcoming issues are tracked asGitHub Issuesin the repository.How to obtain supportIf you encountered a bug or have a feature request, please create aGitHub Issuein the repository.
You can also get in touch with the developers directly by reaching out toproject.sailor@sap.comin order to obtain support.ContributingWe welcome all contributions either in form of issues, code contributions, questions or any other formats. For details please refer to theContributing Pagein the documentation.LicensingPlease see ourLICENSEfor copyright and license information. Detailed information including third-party components and their licensing/copyright information is available via theREUSE tool.