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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: alchemyml-0.1.18.tar.gz
  • Upload date:
  • Size: 7.5 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.18.tar.gz
Algorithm Hash digest
SHA256 592d58f98e3610a747e96e5ca90a809ceabab850f7613cf346304a3cf0bb4120
MD5 ab50adac0ffc3b4af6127ad2efa1e82b
BLAKE2b-256 eeeb107ac0d4c0411f100c28e3cf62ce432f054cc3973c5534afae6dd25608bf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: alchemyml-0.1.18-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.18-py3-none-any.whl
Algorithm Hash digest
SHA256 61212eba377871fc68f422109dd22b1aeb6c96ebbe24b5a030d4ca88a6e82c24
MD5 c028de4219e67958e15569b3f1755acf
BLAKE2b-256 0af9165b4c2d5f8abc786b4fd02939c0d5338e17d4e9eb1453f48459eab76f0d

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