This project is a high-level interface designed to interact with the API of Scorpion. It provides a convenient way to access and utilize the functionalities of the Scorpion API. Additionally, it includes plugins that enable the extraction of key performance indicators (KPIs) from various monitoring systems. These plugins allow users to easily extract and transform KPI measurements to submit them to Scorpion.
To install the Scorpion Client from the release, follow these steps:
- Download the relevant file from:
https://github.com/IPK-BIT/scorpion-client/releases
- Install the dependecy with:
pip install /path/to/package.tar.gz
orpip install /path/to/package.whl
To install the Scorpion Client from source, follow these steps:
- Clone the repository:
git clone https://github.com/IPK-BIT/scorpion-client.git
- Navigate to the project directory:
cd scorpion-client
- Install the project dependencies:
poetry install
To interact with the Scorpion API, create and use the Scorpion Client as follows:
from scorpion_client import ScorpionClient
client = ScorpionClient(os.getenv('BASE_URL'), os.getenv('API_KEY'))
services = client.getServices()
print(services)
Scorpion Client includes features to interact with monitoring systems to extract and transform the KPI measurements from. Those features are made available through a Plugin Interface and can be used as follows:
from scorpion_client import DataSource
from scorpion_client.data_sources.matomo import Matomo
matomo = DataSource('matomo', Matomo(os.getenv('MATOMO_BASE_URL'), os.getenv('MATOMO_AUTH_TOKEN')))
web_stat_data = matomo.extract({'site_id': os.getenv('MATOMO_SITE_ID'), 'period': 'month', 'date': 'today'})
web_stats = matomo.transform(web_stat_data)
Contributions are welcome! If you would like to contribute to the Scorpion Client, please follow these guidelines:
- Fork the repository
- Create a new branch:
git checkout -b feature/your-feature-name
- Make your changes and commit them:
git commit -m "Add your changes"
- Push to the branch:
git push origin feature/your-feature-name
- Open a pull request
This project is licensed under the MIT License. See the LICENSE file for more details.