Panel: Enable a Panel app to serve or appear to serve a REST api

Created on 23 Feb 2020  路  2Comments  路  Source: holoviz/panel

My Pain

I would like to serve dynamically generated documents like text, csv, excel, json, images at url endpoints that include search parameters.

I would like to expose my functions, models, plots etc. as REST api endpoints with get, post, put, patch and delete methods.

I would the api endpoints to appear on the same url as my Panel app. I.e. the app at for example example.com and the api at example.com/api.

I would like the functionality to auto-generate Open API/ Swagger API documentation so that it is easy for developers to understand the api and easy to use with C#, Angular etc. as it can automatically generate the boiler plate code needed.

Solution

Enable panel to use to serve REST Api Endpoints.

Alternative Solution

Don't provide this a functionality as a part of Panel but instead provide some documentation to a best practice solution like Fast API, Django REST Api, Flask or similar. Or maybe a pointer to how the already running Tornado server can be used.

If this is the solution please also describe how to integrate this with the Panel app. I.e. that they are using the same url. Maybe Panel could just do the reverse proxying?

example.com/
example.com/api

One thing I would like described is really the integration with param. I.e. if I have param.Parameterized model. How to I extract the data? Do I use SqlAlchemy? Can I do that easily that easily? How do I serialize a param.Parameterized model? What about security? How would that work and can it integrate with Panel?

enhancement

Most helpful comment

We have a contract in place that will require implementing this so this will happen in the near term.

All 2 comments

@philippjfr . Just some words on your thoughts and how you would do this would be very valuable. Maybe me or some other user could try it out in our own apps, return the learnings and then one day this could be a part of Panel.

We have a contract in place that will require implementing this so this will happen in the near term.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MarcSkovMadsen picture MarcSkovMadsen  路  3Comments

zassa picture zassa  路  4Comments

MarcSkovMadsen picture MarcSkovMadsen  路  5Comments

philippjfr picture philippjfr  路  3Comments

MarcSkovMadsen picture MarcSkovMadsen  路  4Comments