IO

HTTP

http_get()

class p5.http_get(url)

Performs a synchronous GET request on the given url.

Parameters:url (string) – url of the API

http_post()

p5.http_post(url, post_data)

Performs a synchronous POST request on the given url.

Parameters:
  • url (string) – url of the API
  • post_data (dict) – Key-value pairs of the request payload.

Local

Loading Tables

class p5.Table(path, seperator)

Class to represent tabular data

Parameters:path (string) – Path to the CSV file.
getArray()
Returns:the entire csv data as an multidimensional array.
Return type:list
getColumn(name)
Parameters:name (string) – Name of the required column
Returns:An entire column based on the column index.
Return type:list
getColumnCount()
Returns:Number of columns in the read CSV.
Return type:int
getRow(index)

Returns an entire row when given the row index.

Parameters:index (string) – Name of the row
Returns:An entire row when given the row index.
Return type:list
getRowCount()
Returns:Number of rows in the read CSV.
Return type:int
get_array()
Returns:the entire csv data as an multidimensional array.
Return type:list
get_column(name)
Parameters:name (string) – Name of the required column
Returns:An entire column based on the column index.
Return type:list
get_column_count()
Returns:Number of columns in the read CSV.
Return type:int
get_row(index)

Returns an entire row when given the row index.

Parameters:index (string) – Name of the row
Returns:An entire row when given the row index.
Return type:list
get_row_count()
Returns:Number of rows in the read CSV.
Return type:int

load_table()

p5.load_table(path, mode='csv')

Calls Table class and returns a Table class object

Parameters:
  • path (string) – Path to file
  • mode (string) – Type of File csv/ssv/tsv.
Returns:

A table object

Return type:

object