pyteseo.io.substances

Manage offline substance data stored in xlsx-files @ pyteseo/data/substances

Attributes

SUBSTANCES_OFFLINE_PATH

Functions

fetch_substances_properties_from_teseo_management_api(→ list)

fetch_sar_properties_from_teseo_management_api(→ list)

fetch_sar_properties_from_pyteseo_db(→ list)

fetch_substances_properties_from_pyteseo_db(...)

retrieve a substance in a pandas Dataframe

get_offline_substance_names(→ list)

get all substance names availables for a specific substance type

generate_substances_df(→ pandas.DataFrame)

convert json substance response from TESEO.Management.API to pd.DataFrame

Module Contents

pyteseo.io.substances.SUBSTANCES_OFFLINE_PATH
pyteseo.io.substances.fetch_substances_properties_from_teseo_management_api(names: list, auth_header: str) list
pyteseo.io.substances.fetch_sar_properties_from_teseo_management_api(names: list, auth_header: str) list
pyteseo.io.substances.fetch_sar_properties_from_pyteseo_db(names: list) list
pyteseo.io.substances.fetch_substances_properties_from_pyteseo_db(substance_type: str, substance_names: list) pandas.DataFrame

retrieve a substance in a pandas Dataframe

Parameters:
  • substance_type (str) – [“oil”, “hns”]

  • substance_names (str) – name of the substance required

Raises:
  • FileNotFoundError – if database (oil.xlsx and hns.xlsx) are not located at SUBSTANCES_OFFLINE_PATH env variable

  • ValueError – if substance name is not in the database

Returns:

substances data

Return type:

pd.DataFrame

pyteseo.io.substances.get_offline_substance_names(substance_type: str) list

get all substance names availables for a specific substance type

Parameters:

substance_type (str) – [“oil”, “hns”]

Raises:

FileNotFoundError – if database (oil.xlsx or hns.xlsx) are not located at SUBSTANCES_OFFLINE_PATH env variable

Returns:

names of the susbstances

Return type:

list

pyteseo.io.substances.generate_substances_df(json_response: list) pandas.DataFrame

convert json substance response from TESEO.Management.API to pd.DataFrame

Parameters:

json_response (dict) – TESEO.apistore json response

Returns:

substances data

Return type:

pd.DataFrame