Skip to main content

AlchemyML API package

Project description

AlchemyML API Documentation

Version Date: 2020-03-17


Table of Contents

[TOC]

Prerequisites

Sys, json, OS, requests.adapters.HTTPAdapter, urllib3.util.retry.Retry, pickle

Dependencies

Module Overview

Description

AlchemyML API

Flowchart

List of scripts and their functions

  • _CRUD_classes
    • authentication()
      • get_api_token
    • dataset()
      • upload
      • view
      • update
      • delete
      • statistical_descriptors
    • experiment()
      • create
      • view
      • update
      • delete
      • statistical_descriptors
      • results
      • add_to_project
      • extract_from_project
      • send
    • project()
      • create
      • view
      • update
      • delete
  • _manual_ops
    • actions()
      • list_preprocessed_dataframes
      • download_dataframe
      • prepare_dataframe
      • encode_dataframe
      • drop_highly_correlated_components
      • impute_inconsistencies
      • drop_invalid_columns
      • target_column_analysis
      • balancing_dataframe
      • initial_exp_info
      • impute_missing_values
      • merge_cols_into_dt_index
      • detect_experiment_type
      • build_model
      • operational_info
      • detect_outliers
      • impute_outliers
      • download_properties_df

CRUD_classes.py - Code explanations

Intro

Prerequisites - Imports

  • Python packages:
    • JSON: import json
    • OS: import os
    • Sys: import sys
  • Functions from request_handler:
    • from request_handler import retry_session, general_call

class authentication

The class to be used to authenticate, through the get_api_token method.

method get_api_token

def get_api_token(self, username, password):
    url = url_base + '/token/'
    data = json.dumps({'username':username, 'password':password})
    session = retry_session(retries = 10)
    r = session.post(url, data, verify = False)

    if r.status_code == 200:
        tokenJSON = json.loads(r.text)
        return r.status_code, tokenJSON['access']
    else:
        msgJSON = json.loads(r.text)
        msg = msgJSON['message']
        return r.status_code, msg
Description

This method returns the necessary token to be used from now on for the API requests. To be able to make use of the API before all it is necessary to sign-up.

I/O
  • Parameters:

    • username (str): Username
    • password (str): Password
  • Returns:

    • Status code (int)
    • Message (str) with the result

class dataset

This class unifies and condenses all the operations related to datasets in their most general sense: uploading them to the workspace, listing them, removing them...

Each and every operation (request) needs the token that is obtained through the class authentication.

method upload

    def upload(self, *args, **kwargs):  
        str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
        input_args = locals()['args']
        input_kwargs = locals()['kwargs']

        return general_call(str_meth_name, input_args, input_kwargs)
Description
I/O
  • Parameters:
    • token (str): API Token
    • file_path (str): The path where the dataset file is located
    • dataset_name (str): Custom name for the dataset file
    • description (str, optional): Optional parameter to specify description if needed for the dataset. If no description is inputted, no description is added to the dataset.

method upload

    def upload(self, *args, **kwargs):  
        str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
        input_args = locals()['args']
        input_kwargs = locals()['kwargs']

        return general_call(str_meth_name, input_args, input_kwargs)
Description
I/O
  • Parameters:
    • token (str): API Token
    • file_path (str): The path where the dataset file is located
    • dataset_name (str): Custom name for the dataset file
    • description (str, optional): Optional parameter to specify description if needed for the dataset. If no description is inputted, no description is added to the dataset.

method upload

    def upload(self, *args, **kwargs):  
        str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
        input_args = locals()['args']
        input_kwargs = locals()['kwargs']

        return general_call(str_meth_name, input_args, input_kwargs)
Description
I/O
  • Parameters:
    • token (str): API Token
    • file_path (str): The path where the dataset file is located
    • dataset_name (str): Custom name for the dataset file
    • description (str, optional): Optional parameter to specify description if needed for the dataset. If no description is inputted, no description is added to the dataset.

method upload

    def upload(self, *args, **kwargs):  
        str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
        input_args = locals()['args']
        input_kwargs = locals()['kwargs']

        return general_call(str_meth_name, input_args, input_kwargs)
Description
I/O
  • Parameters:
    • token (str): API Token
    • file_path (str): The path where the dataset file is located
    • dataset_name (str): Custom name for the dataset file
    • description (str, optional): Optional parameter to specify description if needed for the dataset. If no description is inputted, no description is added to the dataset.

method upload

    def upload(self, *args, **kwargs):  
        str_meth_name = self.class_name + '.' + sys._getframe().f_code.co_name
        input_args = locals()['args']
        input_kwargs = locals()['kwargs']

        return general_call(str_meth_name, input_args, input_kwargs)
Description
I/O
  • Parameters:
    • token (str): API Token
    • file_path (str): The path where the dataset file is located
    • dataset_name (str): Custom name for the dataset file
    • description (str, optional): Optional parameter to specify description if needed for the dataset. If no description is inputted, no description is added to the dataset.

class experiment

The class to be used to authenticate, through the get_api_token method.

method get_api_token

def get_api_token(self, username, password):
    url = url_base + '/token/'
    data = json.dumps({'username':username, 'password':password})
    session = retry_session(retries = 10)
    r = session.post(url, data, verify = False)

    if r.status_code == 200:
        tokenJSON = json.loads(r.text)
        return r.status_code, tokenJSON['access']
    else:
        msgJSON = json.loads(r.text)
        msg = msgJSON['message']
        return r.status_code, msg
Description

This method returns the necessary token to be used from now on for the API requests. To be able to make use of the API before all it is necessary to sign-up.

I/O
  • Parameters:

    • username (str): Username
    • password (str): Password
  • Returns:

    • Status code (int)
    • Message (str) with the result

class project

The class to be used to authenticate, through the get_api_token method.

method get_api_token

def get_api_token(self, username, password):
    url = url_base + '/token/'
    data = json.dumps({'username':username, 'password':password})
    session = retry_session(retries = 10)
    r = session.post(url, data, verify = False)

    if r.status_code == 200:
        tokenJSON = json.loads(r.text)
        return r.status_code, tokenJSON['access']
    else:
        msgJSON = json.loads(r.text)
        msg = msgJSON['message']
        return r.status_code, msg
Description

This method returns the necessary token to be used from now on for the API requests. To be able to make use of the API before all it is necessary to sign-up.

I/O
  • Parameters:

    • username (str): Username
    • password (str): Password
  • Returns:

    • Status code (int)
    • Message (str) with the result

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

alchemyml-0.1.20.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

alchemyml-0.1.20-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file alchemyml-0.1.20.tar.gz.

File metadata

  • Download URL: alchemyml-0.1.20.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.6.4

File hashes

Hashes for alchemyml-0.1.20.tar.gz
Algorithm Hash digest
SHA256 a36f09ba8576721c606fa44335c3fb3055ce5a0424efabbc0fc32de4a5addb10
MD5 fbdf003fb9f592df7c5220d2afca82f4
BLAKE2b-256 44d7c2e7ecfcc4179fd3cf4946ffe028327e1a630dd1d86e98ad5d19d6d72bfc

See more details on using hashes here.

File details

Details for the file alchemyml-0.1.20-py3-none-any.whl.

File metadata

  • Download URL: alchemyml-0.1.20-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.6.4

File hashes

Hashes for alchemyml-0.1.20-py3-none-any.whl
Algorithm Hash digest
SHA256 17849e3faf53652e99a40f09b964de5e0952b14b92fb036c583bc9addb326fdb
MD5 c1832d80b32a292310aecda370fae828
BLAKE2b-256 d88c0092d330da7f43967f13b2d630b4fa354326d4ad7b4e3756e5119ae52e6b

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