Python Pandas to Excel via REST API
Budget: £20 – £250 GBP
I have a Python function that returns a pandas DataFrame. I would like to expose this function via a basic REST API (preferably written in Flask), and then be able to access that data in Excel, via a VBA function (or otherwise).
For example, the following Python demo function:
def demo(rows, cols):
return pd.DataFrame(np.random.rand(len(rows), len(cols)), index=rows, columns=cols)
An example call would be :
demo(pd.date_range('2022-01-01', '2022-01-05'), cols=['AA','BB','CC'])
I want to expose this Python function via a REST API, and then in Excel call a VBA function and pass in parameters (e.g. 5 dates and 3 columns) from Excel and receive back the data array. This should appear in the Excel worksheet (i.e. the numeric values, along with row and column labels).
I do NOT want to call the Python code directly from Excel. Assume the Python code is running on a separate server from Excel.
I am familiar with Flask so would like to use that for the REST API, but am open to other suggestions. Similarly I envisage having an VBA function to pull the data into Excel but am again open to suggestions.
I would expect to receive python code for the REST API, and VBA code for the Excel function.
This is a simple proof of concept. I don't need any REST authentication. This is a low volume of data. I am not worried about numeric precision.
For example, the following Python demo function:
def demo(rows, cols):
return pd.DataFrame(np.random.rand(len(rows), len(cols)), index=rows, columns=cols)
An example call would be :
demo(pd.date_range('2022-01-01', '2022-01-05'), cols=['AA','BB','CC'])
I want to expose this Python function via a REST API, and then in Excel call a VBA function and pass in parameters (e.g. 5 dates and 3 columns) from Excel and receive back the data array. This should appear in the Excel worksheet (i.e. the numeric values, along with row and column labels).
I do NOT want to call the Python code directly from Excel. Assume the Python code is running on a separate server from Excel.
I am familiar with Flask so would like to use that for the REST API, but am open to other suggestions. Similarly I envisage having an VBA function to pull the data into Excel but am again open to suggestions.
I would expect to receive python code for the REST API, and VBA code for the Excel function.
This is a simple proof of concept. I don't need any REST authentication. This is a low volume of data. I am not worried about numeric precision.