Easily access data from your SAP Digital Supply Chain software products for data science projects like predictive maintenance or master data analysis.
Project description
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 our tutorial page. “Sailor” provides you with a set of functions out of the box, but most importantly it facilitates flexibility and extensibility.
Requirements
You 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”.
Installation
Install the package with pip
pip install sailor
Configuration
“Sailor” talks to two services: SAP Asset Central and SAP IoT. You have two options of specifying the configuration:
The above order is honoured when “Sailor” checks for the configuration.
Environment
A JSON string can be provided with the environment variable SAILOR_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 file
Specify 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 named config.yml next to your main script/notebook without setting the SAILOR_CONFIG_PATH. Example YAML file:
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.sap.<landscape>.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
Quickstart Example
The 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 our tutorial page. It will walk you through the functionality offered by project “Sailor” step by step.
import pandas as pd
from sailor.assetcentral import find_equipment, find_notifications
# find equipments and plot them
equipment_set = find_equipment(model_name='my_model_name')
equipment_set.plot_distribution('location_name')
# get sensor data from equipment
timeseries_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 them
notification_set = equipment_set.find_notifications(extended_filters=['malfunction_start_date > "2020-08-01"'])
notification_set.plot_overview()
Limitations
Currently 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 Issues
There are currently no known issues. All upcoming issues are tracked as GitHub Issues in the repository.
How to obtain support
If you encountered a bug or have a feature request, please create a GitHub Issue in the repository. You can also get in touch with the developers directly by reaching out to project.sailor@sap.com in order to obtain support.
Contributing
We welcome all contributions either in form of issues, code contributions, questions or any other formats. For details please refer to the Contributing Page in the documentation.
Licensing
Please see our LICENSE for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available via the REUSE tool.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sailor-1.9.0.tar.gz
.
File metadata
- Download URL: sailor-1.9.0.tar.gz
- Upload date:
- Size: 62.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e729614e6cde20fa5b06ddf53f589c3c8fec6a37025726867d998c34e931c2f9 |
|
MD5 | cfe724971af7d8603b7c98a2d1590000 |
|
BLAKE2b-256 | ceafb526508f82dd5342c181ea0aac5aee13b184d1222d4d5aa31f0e4fad46f7 |
File details
Details for the file sailor-1.9.0-py3-none-any.whl
.
File metadata
- Download URL: sailor-1.9.0-py3-none-any.whl
- Upload date:
- Size: 79.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cb76de95f0fcf345121948ba43dc3d06570b5f8e5020fff7f10e9a2150b8b51 |
|
MD5 | 02a1f065d03d4aa451a21caf8f85844b |
|
BLAKE2b-256 | b2813e9463617886d9a94be53a8926943ccf4e0d4e0d28ad8716bb6a98a8d8cd |