Skip to main content

A python API client for using Alchemite Analytics

Project description

alchemite-apiclient

This is a client for interacting with Alchemite Analytics, an applied machine learning platform to accelerate industrial R&D and optimise manufacturing by extracting information from sparce or noisy datasets. To obtain a licence for this product, please contact Intellegens for more information.

API version: 0.55.0

Requirements.

Python >=3.8

Installation & Usage

pip install

Either you can install this from the public pip repository using:

pip install alchemite-apiclient

Alternatively, you can install it from a zip archive using:

pip install ./api_client_python-version.zip

(you may need to run pip with root permission: sudo pip install ./api_client_python-version.zip)

Then import the package:

import alchemite_apiclient

Getting Started

Please follow the installation procedure.

Examples can be found in the source distribution, downloadable from https://pypi.org/project/alchemite-apiclient/#files

Then place your credentials.json file in the "example" directory and run

python example_connect.py

This should connect to the API server and, if successful, print something like this to the terminal (the numbers you see may be different):

------ API version -----
{'alchemite_version': '20200414',
 'api_application_version': '0.15.3',
 'api_definition_version': '0.14.3'}

If instead you encounter an error at this stage please contact Intellegens for further guidance.

Next, look through and try running example/example_basic.py. This will upload a small dataset, train a basic model with the default hyperparameters and predict the missing values from a dataset.

Examples of other functionality possible through the Alchemite API are given by:

  • example/example_hyperopt.py train an optimal model using hyperparameter optimization and impute the training dataset
  • example/example_chunk.py upload a larger dataset in chunks
  • example/example_delete.py delete models and datasets
  • example/example_optimize.py search the model's parameter space for parameters predicted to meet certain targets
  • example/example_outliers.py find outliers in the model's training dataset
  • example/example_preload.py preload a model into memory to make predictions for larger models faster

Credentials

The credentials.json file requires the following elements:

  • host: The base uri of the Alchemite api you are attempting to use. (Ordinarily https://alchemiteapi.intellegens.ai/v0)
  • client_id: The client id to use for authentication. (Ordinarily PythonClient)
  • grant_type: One of password, client_credentials, authorization_code.

Grant types each have additional elements:

Authorization Code:

This will open a browser to prompt for user credentials for using the API. This is the recommended way of authenticating.

  • offline (optional): If true, the client will attempt to acquire an offline token to persist user authentication between sessions. This token is stored in a .alchemite_token file in the working directory.

Password:

This will use credentials collected from the commandline to authenticate with the API.

  • username (optional): The username to log in with. If omitted the user will be prompted to enter it
  • password (optional): The password to log in with. If omitted the user will be prompted to enter it
  • offline (optional): If true, the client will attempt to acquire an offline token to persist user authentication between sessions. This token is stored in a .alchemite_token file in the working directory.

Client Credentials:

Attempts to authenticate using a client secret.

  • client_secret: The client secret to use for authentication.

Offline tokens

Offline tokens persist indefinitely, but will expire if unused for more than 30 days. In the event that the token is lost or stolen, it can be revoked from your profile page in the Applications tab.

Reference documentation corresponding to each API endpoint can be found in the docs directory of the source distribution.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alchemite_apiclient-0.55.0.tar.gz (413.4 kB view details)

Uploaded Source

Built Distribution

alchemite_apiclient-0.55.0-py3-none-any.whl (781.5 kB view details)

Uploaded Python 3

File details

Details for the file alchemite_apiclient-0.55.0.tar.gz.

File metadata

  • Download URL: alchemite_apiclient-0.55.0.tar.gz
  • Upload date:
  • Size: 413.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for alchemite_apiclient-0.55.0.tar.gz
Algorithm Hash digest
SHA256 ea986e9f34f979440ec9613472ab0e5dcf18a1f18376af688a8ed4143a9efdee
MD5 dee8642039375b7bca5af28a6b649055
BLAKE2b-256 f563c0f4a37906c690e2e8ff9bd91cb670ba1e171f1f5549a0466de9151c944b

See more details on using hashes here.

File details

Details for the file alchemite_apiclient-0.55.0-py3-none-any.whl.

File metadata

File hashes

Hashes for alchemite_apiclient-0.55.0-py3-none-any.whl
Algorithm Hash digest
SHA256 53a4c32b21193c8e71d7ad8330016e4aceb2b7e4fe9582306967625d80defa6d
MD5 5e076acc619243c8c0e74e629165bb7d
BLAKE2b-256 af7f7b0718e0f80cf68699f132d2c503fbd24764a1c85f83cb7957ddef7ce163

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page