inquire-modeltest-sdk

SDK for the Assets API

Status

Python testingUpload Python Package

General

About

SDK for inquire-assets API.

Contribute

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

  • Install Python version 3.6.9 or later from either https://www.python.org or https://www.anaconda.com.

Use as Python package

Pip-install package from packagr. pip install inquire_assets_sdk --extra-index-url https://api.packagr.app/EYvhW6Syl/

Code examples

Code examples are found in the /examples folder These can either be opened in google Colab or downloaded and used with anacondas jupyter notebooks

Clone the source code repository

At the desired location, run:

git clone https://github.com/SevanSSP/inquire-assets-sdk-python.git

Setup Python environment

Create an isolated Python environment and activate it,

```console python -m venv /path/to/new/virtual/environment

/path/to/new/virtual/environment/Scripts/activate ```

... and install the dev dependencies in poetry.lock,

console poetry install

Deployment

The application is published as a package to Sevans packagr site. To use this library in other projects use:

pip install inquire_assets_sdk --extra-index-url https://api.packagr.app/EYvhW6Syl/ -U

Continue by logging in to the packagr server with your credentials.

Run the tests

To run all tests:

pytest tests

This requires the environmental variables INQUIRE_ASSETS_API_HOST, INQUIRE_ASSETS_API_USER, INQUIRE_ASSETS_API_PASSWORD Where the API-host is a local instance of the inquire-assets-api application, and the username/password are stored in the relevant database.

File structure

|-- .github  
|   |-- workflows  
|       |-- publish-package.yml # Github actions file to publish package of application to packagr  
|       |-- pytest.yml         # Github actions file to run pytest on pull and push to dev / master 
|
|-- inquire_assets_sdk  
|   |-- config.py # Configure connection to API
|   |-- client.py # Client handeling all HTTP-requests to API
|   |-- exceptions.py # Handles error messages from failed HTTP-requests
|   |-- api_resources.py # Abstraction layer betweem client and user-side
|   |-- resources.py # Client-side classes and functions for campaign, timeseries ... etc
|   |-- utils.py # Utility functions used in several parts of the SDK
|
|-- .gitignore
|-- Requirements.txt   # File containing all python packages used
|-- LICENSE
|-- setup.py # Setup file configuring the python package uploaded to Packagr

Versioning

This project uses semantic versioning. More info

Given a version number MAJOR.MINOR.PATCH, increment the:

  • MAJOR version has incompatible API changes,
  • MINOR version add functionality in a backwards compatible manner, and
  • PATCH version for backwards compatible bug fixes.

Important: Keep the API and SDK to the same major versioning

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details.

See also

Links for inquire-assets-sdk