-
-
Notifications
You must be signed in to change notification settings - Fork 527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow serving REST APIs as part of panel serve #1164
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1164 +/- ##
==========================================
- Coverage 86.27% 85.70% -0.58%
==========================================
Files 143 144 +1
Lines 15786 15932 +146
==========================================
+ Hits 13620 13654 +34
- Misses 2166 2278 +112
Continue to review full report at Codecov.
|
This is great, thanks! I'll now check out this branch and test it... |
As far as I can see this supports
If possible it would be so great if this supported
and the documentation hinted at how to use this in practice using serializers etc. I know I'm hoping for a lot. :-) I've added a feature request to tranquilizer for serving csv, xlsx and parquet files ContinuumIO/tranquilizer#20. |
I think for file serving we can easily add a simple static file request handler rather than building that on Tranquilizer or some other REST API. |
Is this a well defined term? Seeing just the title of this PR I didn't have any idea what to expect from its contents. I would use well known and defined terms like REST API across the board, and leave the name of the library as an implementation detail. So on the command like I would just use something along |
Yeah, I hear you, we're still iterating on what we actually want to support and this PR was mostly a prototype for a client. |
@philippjfr . I would like to serve some static files like sphinx documentation, some Angular .js files or similar. But the most important is actually to serve dynamic data in csv, xlsx and parquet format. My primary use case is creating a dashboard and when the user gets to a dead end in the dashboard/ wants more she can get a link to the exact data in the plot, table or similar depending on the state of the app/ the value of sliders, dropdowns etc. She can use the link to download the data here and now. But also store or share the link. Or use PowerQuery in excel to setup a permanent link. Build her own small Panel app using Pandas and use the link to get the data etc. Dynamic, shareable links are powerfull. |
I understand that's a very different thing from a REST API though and is already covered by this issue of yours: #1118 |
90c26e0
to
e9ff759
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me!
Hi @philippjfr, as far as I understand this was part of the 0.10.0 release. Could you please provide an updated minimal example of how to use this? I tried the code snippet from the top of this thread and neither panel version 0.10.0, nor 0.10.3 accepted the --tranquilize option and it seems there are several --rest.. options added instead. UPDATE: I just found the example in the version blog, so just for reference if anybody else looks for this here: |
Allows serving using
panel serve some_script.py some_notebook.ipynb --tranquilize
to serve REST APIs alongside the panel apps. Automatically discovers any tranquilized functions.e.g. this will serve the Panel app on
http://localhost:5006/
and the REST API onhttp://localhost:5006/rest/order
.