Episode 13: Inside Plumber 1.0 (Barret Schloerke Part 2)
A tour of the massive new features in plumber 1.0!
Resources mentioned in the episode
plumber
allows you to create a web API by merely decorating your existing R source code withroxygen2
style comments.- Site: https://www.rplumber.io/
- Demos:
- NEW - Hex logo and website!
- NEW - pipe-able programatic interface
- Demo:
plumb(dir = "plumber/pipe") %>% pr_run()
- Demo:
- NEW - POST body parsing
- Process incoming POST body data
- Ex: HTML forms, multipart forms, csv, tsv, json, yaml, feather and rds.
- Like serializers, register new POST body parsers
- Site: https://www.rplumber.io/reference/parsers.html
- More Serializers!
- Serialize outgoing route data
- Ex: plain
text
,json
,yaml
,csv
,tsv
,rds
,feather
- NEW - Register image serializers:
svg
,tiff
,bmp
,pdf
. (Pre existing:png
,jpeg
) - Site: https://www.rplumber.io/reference/serializers.html
- NEW - Download return values as attachments!
- Site: https://www.rplumber.io/reference/as_attachment.html
- Demo:
plumb_api("plumber", "16-attachment") %>% pr_run()
- NEW - Async / promises
- Demo:
plumb("plumber/plumber-future.R") %>% pr_run()
- Demo:
- NEW - API UIs (rapidoc)
- Register new User Interfaces to look at your API
- Demo:
plumb(dir = "plumber/rapidoc") %>% pr_run()
- Thank you to Bruno Tremblay (
@meztez
) for his heavy contributions to plumber!
- Recent conference talks about plumber:
- Democratizing R with plumber APIs (James Blair): rstudio.com/resources/rstudioconf-2019/democratizing-r-with-plumber-apis
- Practical plumber patterns (James Blair): rstudio.com/resources/rstudioconf-2020/practical-plumber-patterns/
- Bike Prediction example application with plumber API and Shiny: solutions.rstudio.com/tour/bike_predict/
Episode Timestamps
0:00 - Intro
1:14 - Introduction to plumber
4:14 - Example of plumber API
7:14 - Pipeable interface for plumber
9:19 - plumber’s new hex logo!
9:24 - Serializers in plumber
13:04 - Parsers in plumber
14:30 - as_attachment
for serializers
15:50 - Demo of downloading an attachment from API
16:07 - A consistent way to check for plumber APIs with available_apis()
18:50 - Async processing in plumber
24:23 - Demo of the plumber documentation UI
29:20 - Example of decoupling data source from Shiny app
29:50 - Episode wrapup
shinydevseries::session_info()
📽 Find previous interviews at https://shinydevseries.com
📋 Feedback is more than welcome! Please send your comments or suggestions on our contact form at shinydevseries.com/contact
If you enjoyed this video or got value from it, then consider dropping something in the tip jar. Any money raised will be used to improve the channel and invest in additional equipment and resources to make the content even better!
📨 Help shape the future direction of the Shiny Developer Series live streams by completing this very short survey
Media production for the Shiny Developer Series is made possible by these outstanding projects and platforms:
- OBS Studio: https://obsproject.com/
- OBS Fully Loaded install script by Martin Wimpress: https://github.com/wimpysworld/obs-fully-loaded
- VDO Ninja: https://vdo.ninja
- StreamElements: https://streamelements.com
- ShotCut: https://shotcut.org/
- Pop@_OS by System76: https://pop.system76.com/
- Ubuntu: https://ubuntu.com/