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.22.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

alchemyml-0.1.22-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: alchemyml-0.1.22.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.22.tar.gz
Algorithm Hash digest
SHA256 4d62b846aeba887950fcaab29b51cd7a7526a7f4ab41e88fcaa132efe7782431
MD5 1592b8858fd7548521c0fb1d5af96f77
BLAKE2b-256 48310b718418822f362969bcaa19030d4be8069d7f179b6f48c7ca50aa91a2dd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: alchemyml-0.1.22-py3-none-any.whl
  • Upload date:
  • Size: 9.1 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.22-py3-none-any.whl
Algorithm Hash digest
SHA256 e65936107d97d1eb3ee0c49b66b5dd17b0fd5e136c94d84db3b05c94f2b88abe
MD5 2dcb23497972c5c4aafce8dbed7837d2
BLAKE2b-256 097c8a34272cbcc28be8e6bc606c522836822ba50b03125b6abbaa25a54baf1f

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