This is an example project demonstrating how to use the SAP (SA Provider) library to create a data provider.
-
Create and activate virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the example provider:
python example_provider.py
- Creates a simple data provider that serves employee data
- Demonstrates the
make_object,timestamp, andlinkhelpers - Shows how to configure the SAP server with custom settings
- Runs on port 8080 with automatic data refresh every 60 seconds
Once running, you can access:
http://localhost:8080/hello- Provider informationhttp://localhost:8080/all_data- Cached data objectshttp://localhost:8080/health- Health statushttp://localhost:8080/status- Detailed status
Edit example_provider.py to:
- Change the data source
- Modify the refresh interval
- Add more data fields
- Customize the provider name and description
SAP_example/
├── venv/ # Virtual environment (created by you)
├── requirements.txt # Dependencies (installs SAP from GitHub)
├── README.md # This file
└── example_provider.py # Example provider implementation