Hacarus.SpectroSdk

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

This Python package is automatically generated by the OpenAPI Generator project:

Requirements.

Python >=3.6

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import Hacarus.SpectroSdk

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import Hacarus.SpectroSdk

Getting Started

Please follow the installation procedure and then run the following:


import time
import Hacarus.SpectroSdk
from pprint import pprint
from Hacarus.SpectroSdk.api import algorithms_api
from Hacarus.SpectroSdk.model.algorithm_with_parameter_list_wrapper import AlgorithmWithParameterListWrapper
from Hacarus.SpectroSdk.model.algorithm_with_parameter_wrapper import AlgorithmWithParameterWrapper
from Hacarus.SpectroSdk.model.base_error import BaseError
from Hacarus.SpectroSdk.model.h_model_wrapper import HModelWrapper
from Hacarus.SpectroSdk.model.train_request import TrainRequest
# Defining the host is optional and defaults to https://sdd-api-staging.hacarus.com
# See configuration.py for a list of all supported configuration parameters.
configuration = Hacarus.SpectroSdk.Configuration(
    host = "https://sdd-api-staging.hacarus.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): jwt
configuration = Hacarus.SpectroSdk.Configuration(
    access_token = 'YOUR_BEARER_TOKEN'
)

# Configure OAuth2 access token for authorization: oauth2
configuration = Hacarus.SpectroSdk.Configuration(
    host = "https://sdd-api-staging.hacarus.com"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'


# Enter a context with an instance of the API client
with Hacarus.SpectroSdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = algorithms_api.AlgorithmsApi(api_client)
    algorithm_id = "algorithm_id_example" # str | 

    try:
        # Get Algorithm by ID
        api_response = api_instance.get_algorithm_by_id(algorithm_id)
        pprint(api_response)
    except Hacarus.SpectroSdk.ApiException as e:
        print("Exception when calling AlgorithmsApi->get_algorithm_by_id: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://sdd-api-staging.hacarus.com

Class Method HTTP request Description
AlgorithmsApi get_algorithm_by_id GET /api/v1/algorithms/{algorithm_id} Get Algorithm by ID
AlgorithmsApi get_algorithms GET /api/v1/algorithms/ Get List of Algorithms
AlgorithmsApi train POST /api/v1/algorithms/{algorithm_id}/train Train
ItemsApi add_item POST /api/v1/items/ Add Item
ItemsApi annotate PATCH /api/v1/items/{item_id}
ItemsApi del_item DELETE /api/v1/items/
ItemsApi get_item_by_id GET /api/v1/items/{item_id} Get Item by Id
ItemsApi get_items_by_type GET /api/v1/items/ Get List of Items
ModelsApi delete_models DELETE /api/v1/models/ Delete Models
ModelsApi export_models_with_id POST /api/v1/models/export Export models
ModelsApi get_model_by_id GET /api/v1/models/{model_id} Get Model by ID
ModelsApi get_models GET /api/v1/models/ Get List of Models
ModelsApi import_models POST /api/v1/models/import Import models
ModelsApi predict_items POST /api/v1/models/{model_id}/predict Predict Items
ModelsApi set_model_predict_callback POST /api/v1/models/{model_id}/update_predict_callback Set Prediction Callback URL
ModelsApi set_model_predict_parameters POST /api/v1/models/{model_id}/update_predict_parameters Set Prediction Parameters
TargetsApi get_inspection_target_by_id GET /api/v1/targets/{target_id} Get Inspection Target by ID
TargetsApi get_inspection_targets GET /api/v1/targets/ Get List of Inpection Targets
TargetsApi get_model_results POST /api/v1/targets/model/results
TargetsApi set_inspection_target_by_id POST /api/v1/targets/{target_id} Set Default Inspection Target by ID
TokenApi login POST /api/auth/token Authorization
UtilsApi get_hash_id POST /api/v1/utils/node_hash
UtilsApi get_logs POST /api/v1/utils/debug
UtilsApi set_license POST /api/v1/utils/

Documentation For Models

Documentation For Authorization

jwt

oauth2

Author

Notes for Large OpenAPI documents

If the OpenAPI document is large, imports in Hacarus.SpectroSdk.apis and Hacarus.SpectroSdk.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:

Solution 1: Use specific imports for apis and models like:

Solution 2: Before importing the package, adjust the maximum recursion limit as shown below:

import sys
sys.setrecursionlimit(1500)
import Hacarus.SpectroSdk
from Hacarus.SpectroSdk.apis import *
from Hacarus.SpectroSdk.models import *