Skip to content

Commit 79755ed

Browse files
authored
Merge pull request talkpython#110 from manikanta-hitunik-com/patch-110
Update 424-shiny-for-python.txt
2 parents 21ac779 + 744f503 commit 79755ed

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

transcripts/424-shiny-for-python.txt

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88

99
00:00:18 Not any longer.
1010

11-
00:00:20 Joe Chen is here to introduce us to the recently released Shiny for Python, and it looks like a really solid new framework on the block.
11+
00:00:20 Joe Cheng is here to introduce us to the recently released Shiny for Python, and it looks like a really solid new framework on the block.
1212

13-
00:00:28 This is Talk Python and Me, episode 424, recorded June 19th, 2023.
13+
00:00:28 This is Talk Python to Me, episode 424, recorded June 19th, 2023.
1414

1515
00:00:34 [music]
1616

17-
00:00:46 Welcome to Talk Python and Me, a weekly podcast on Python.
17+
00:00:46 Welcome to Talk Python to Me, a weekly podcast on Python.
1818

1919
00:00:50 This is your host, Michael Kennedy.
2020

2121
00:00:52 Follow me on Mastodon, where I'm @mkennedy, and follow the podcast using @talkpython, both on fosstodon.org. Be careful with impersonating accounts on other instances, there are many. Keep up with the show and listen to over seven years of past episodes at talkpython.fm. We've started streaming most of our episodes live on YouTube.
2222

23-
00:01:12 Subscribe to our YouTube channel over at talkpython.fm/youtube to get notified about upcoming shows and be part of that episode. I'm really excited to have a new sponsor for For this episode, welcome on board to GlareDB.
23+
00:01:12 Subscribe to our YouTube channel over at talkpython.fm/youtube to get notified about upcoming shows and be part of that episode. I'm really excited to have a new sponsor for this episode, welcome on board to GlareDB.
2424

2525
00:01:27 GlareDB is an open source database for querying distributed and disparate data.
2626

@@ -62,7 +62,7 @@
6262

6363
00:02:45 Of course, I'm sure.
6464

65-
00:02:46 Shining for Python's gonna be super fun.
65+
00:02:46 Shiny for Python's gonna be super fun.
6666

6767
00:02:49 Before we get to that though, let's get started with your story.
6868

@@ -224,9 +224,9 @@
224224

225225
00:10:43 I know the conversations come up around it.
226226

227-
00:10:46 Other ones that live in a similar orbit, maybe are Streamlet.
227+
00:10:46 Other ones that live in a similar orbit, maybe are Streamlit.
228228

229-
00:10:51 I've had Adrian on, the founder of Streamlet on before, and we've got Dash, and Panel, and Pinecone, and others.
229+
00:10:51 I've had Adrian on, the founder of Streamlit on before, and we've got Dash, and Panel, and Pynecone, and others.
230230

231231
00:10:58 That sets the stage for what this could be about.
232232

@@ -344,11 +344,11 @@
344344

345345
00:17:08 - Right, absolutely.
346346

347-
00:17:09 You don't wanna give them the full notebook because the last thing you want is the general public typing Pantos code in there or arbitrary Python code, but you want to give them some interactivity.
347+
00:17:09 You don't wanna give them the full notebook because the last thing you want is the general public typing Python's code in there or arbitrary Python code, but you want to give them some interactivity.
348348

349349
00:17:20 Maybe we could look at this little example down here, just to talk through what an app might look like.
350350

351-
00:17:27 Right on the homepage, shiny.poset.co, you have, I think this is a big statement towards your commitment to Python.
351+
00:17:27 Right on the homepage, shiny.posit.co, you have, I think this is a big statement towards your commitment to Python.
352352

353353
00:17:36 It's like right on the homepage, on equal, on par with R, it says, get started with R, get started with Python.
354354

@@ -410,7 +410,7 @@
410410

411411
00:19:49 It says, "Could Shiny be used to do fancy math, say for someone trying to upload their GitHub website for their PhD thesis model?" Like, what can we create?
412412

413-
00:19:57 Like, could you create a kind of a LaTeX looking integrated thing with interactive math bits in there?
413+
00:19:57 Like, could you create a kind of a Lots of looking integrated thing with interactive math bits in there?
414414

415415
00:20:03 Right, right. Yeah, yeah.
416416

@@ -424,7 +424,7 @@
424424

425425
00:20:17 It's just whatever you can express in Python or R for that matter.
426426

427-
00:20:20 And in terms of putting like LaTeX equations on the screen, Yes, this is a completely built in feature for Shiny for R and for Shiny for Python.
427+
00:20:20 And in terms of putting like lots equations on the screen, Yes, this is a completely built in feature for Shiny for R and for Shiny for Python.
428428

429429
00:20:31 It's a little less slick, but we do have an example application that shows how to drop in.
430430

@@ -626,7 +626,7 @@
626626

627627
00:28:29 The link is in your podcast player show notes, and please use the link to let them know that you came from us.
628628

629-
00:28:35 Thank you to the team at Clarity Bee for sponsoring the show.
629+
00:28:35 Thank you to the team at GlareDB for sponsoring the show.
630630

631631
00:28:38 So the first thing that you point out here is, how is Shiny different from some of the things I said that it was like, for example, Streamlit or Dash?
632632

@@ -636,7 +636,7 @@
636636

637637
00:28:52 - Sure, and I think really the one that comes up the most is Streamlit.
638638

639-
00:28:56 man, Streamlet really has taken the world by storm, it seems like, since they came out in, what was it, 2018, something like that?
639+
00:28:56 man, Streamlit really has taken the world by storm, it seems like, since they came out in, what was it, 2018, something like that?
640640

641641
00:29:03 - Yeah, I think it was 2018, yeah.
642642

@@ -648,19 +648,19 @@
648648

649649
00:29:15 And I pay a little bit of attention to new things that come out and purport to be high-level web frameworks.
650650

651-
00:29:23 And most of the time, they were sort of like, okay, I recognize the trade offs that they're making here, but the Streamlet one was definitely a very bold choice that they made.
651+
00:29:23 And most of the time, they were sort of like, okay, I recognize the trade offs that they're making here, but the Streamlit one was definitely a very bold choice that they made.
652652

653-
00:29:32 Streamlet, I think it feels to me that they really prioritized ease of getting started and having the simplest possible mental model in a much higher level of priority than everything else, which is a bold stance and I really applaud them for being sort of clear about what their vision is.
653+
00:29:32 Streamlit, I think it feels to me that they really prioritized ease of getting started and having the simplest possible mental model in a much higher level of priority than everything else, which is a bold stance and I really applaud them for being sort of clear about what their vision is.
654654

655-
00:29:50 So Streamlet is unbelievably easy to get started with, I think primarily because, I don't know if you've done a lot of streamlit, but it has this top to bottom execution.
655+
00:29:50 So Streamlit is unbelievably easy to get started with, I think primarily because, I don't know if you've done a lot of streamlit, but it has this top to bottom execution.
656656

657657
00:29:58 A little, not a ton, but yeah.
658658

659659
00:29:59 Yeah.
660660

661661
00:30:00 Like if you were to start out with not a Jupyter notebook, but like a regular Python script that was doing a bunch of data analysis stuff, you know, reading data, maybe doing some transformations and then outputting some, you know, tables and plots.
662662

663-
00:30:14 Streamlit lets you take that sort of straight up and down script and sprinkle in some streamlit inputs and outputs and boom, like you have now written an interactive streamlet app, you just say, you know, streamlet run and then the name of the file and it just works in that sense. It's quite incredible. It's very easy to get started with and the cost to spin up a new streamlet app is so low that I was actually talking to another to a YouTuber, Fanilo. I don't remember his last name. I think there's one Fanilo in the streamlet world and he was saying that he actually uses this instead of Jupyter Notebooks to do interactive, you know, exploratory data analysis, which I thought was interesting. The sort of drawback of having this simple of a model is that it really works well for the simplest apps. And then the model is a little bit too simple for even like moderately complex. It's not even complex, but just like you're you sooner or later, will often in a surprising way, smack into some surprising wall.
663+
00:30:14 Streamlit lets you take that sort of straight up and down script and sprinkle in some streamlit inputs and outputs and boom, like you have now written an interactive streamlit app, you just say, you know, streamlit run and then the name of the file and it just works in that sense. It's quite incredible. It's very easy to get started with and the cost to spin up a new streamlit app is so low that I was actually talking to another to a YouTuber, Fanilo. I don't remember his last name. I think there's one Fanilo in the streamlit world and he was saying that he actually uses this instead of Jupyter Notebooks to do interactive, you know, exploratory data analysis, which I thought was interesting. The sort of drawback of having this simple of a model is that it really works well for the simplest apps. And then the model is a little bit too simple for even like moderately complex. It's not even complex, but just like you're you sooner or later, will often in a surprising way, smack into some surprising wall.
664664

665665
00:31:16 This is not something that is theoretical.
666666

@@ -672,7 +672,7 @@
672672

673673
00:32:09 But I think no one who uses Streamlit seriously will tell you that you can do most of the things that you want in this sort of top-to-bottom execution model. You will often, in surprisingly quick ways, run into limitations there. And I do want to say, Streamlit, they recognized this.
674674

675-
00:32:26 And after some time, they added, "Try to give you ways to work around that top-to-bottom execution model. They introduced the notion of session state and they introduced multiple attempts at nice caching abstractions. And I think they make somewhat more complex apps possible. But I really, I mean, I'm happy to recommend Streamlet for those easy cases. I cannot recommend Streamlet once you start, you know, getting into session state. It really is quite a fragile paradigm to be coding in.
675+
00:32:26 And after some time, they added, "Try to give you ways to work around that top-to-bottom execution model. They introduced the notion of session state and they introduced multiple attempts at nice caching abstractions. And I think they make somewhat more complex apps possible. But I really, I mean, I'm happy to recommend Streamlet for those easy cases. I cannot recommend Streamlit once you start, you know, getting into session state. It really is quite a fragile paradigm to be coding in.
676676

677677
00:33:00 And by the way, just to make it clear here, I don't have a huge financial like motivation to lie about this.
678678

@@ -744,9 +744,9 @@
744744

745745
00:35:18 Oh, I forget that, yeah, for your listeners, they won't be able to see it.
746746

747-
00:35:22 This is an example of a relatively simple set of inputs and one 3D output that I think in this case is being rendered with matplotlib. And you can choose some different parameters about the Earth, Moon, and Sun, and Planet X. And it has arbitrarily complicated calculations happening on the back end by AstroPi to determine how these bodies would move when they're affected by each other's gravity. There's a lot of Shiny apps that are like this, that there is one particular algorithm, one particular model that it's demonstrating, and then wanting to show what happens when you try different parameters. So I'd say this is sort of in the simplest category of Shiny apps in terms of what's easy to imagine here. And yeah, there's some other stuff on the left there. Some of the example apps show the use of different widgets. So there's one for Plotly there. You can use the plotly JavaScript based visualization library with Shiny for Python.
747+
00:35:22 This is an example of a relatively simple set of inputs and one 3D output that I think in this case is being rendered with matplotlib. And you can choose some different parameters about the Earth, Moon, and Sun, and Planet X. And it has arbitrarily complicated calculations happening on the back end by AstroPy to determine how these bodies would move when they're affected by each other's gravity. There's a lot of Shiny apps that are like this, that there is one particular algorithm, one particular model that it's demonstrating, and then wanting to show what happens when you try different parameters. So I'd say this is sort of in the simplest category of Shiny apps in terms of what's easy to imagine here. And yeah, there's some other stuff on the left there. Some of the example apps show the use of different widgets. So there's one for Plotly there. You can use the plotly JavaScript based visualization library with Shiny for Python.
748748

749-
00:36:22 If you want your scatter plots to have, you know, tool tips that show, you know, data, for example. I mean, this particular one seems not to do that much. And, you know, you can use -- yeah, there's a -- there's a Wordle clone.
749+
00:36:22 If you want your scatter plots to have, you know, tool tips that show, you know, data, for example. I mean, this particular one seems not to do that much. And, you know, you can use -- yeah, there's a -- there's a Wordy clone.
750750

751751
00:36:35 >> No, it looks like a -- it looks like a mobile phone keyboard. I mean, I have a whole keyboard right here. I was like, now you can type into the mobile phone keyboard.
752752

@@ -922,7 +922,7 @@
922922

923923
00:44:31 So I really do believe there are a lot of different ways people are solving this problem in Python.
924924

925-
00:44:38 Streamlit and Dash each have their own takes, and Pinecone and Solara are all these different ones.
925+
00:44:38 Streamlit and Dash each have their own takes, and Pynecone and Solaris are all these different ones.
926926

927927
00:44:43 And the ones that have thought carefully about this problem of how do you help people programming against what is inherently a dynamic system while staying safe, while making sure that you're getting the right answers every time and doing it in an efficient way.
928928

@@ -970,7 +970,7 @@
970970

971971
00:47:08 Like you're creating a chunk of code, which in Python is a function, and then you are annotating it with an indicator of your intent.
972972

973-
00:47:16 So in Shiny, you would write, you know, for a plot output, you would say def plot one or whatever you named that plot, you would have your map plot libcode inside, and then as a decorator to that function, you would say, this is an output and the type of the output is a plot.
973+
00:47:16 So in Shiny, you would write, you know, for a plot output, you would say def plot one or whatever you named that plot, you would have your matplotlib code inside, and then as a decorator to that function, you would say, this is an output and the type of the output is a plot.
974974

975975
00:47:32 Now, I will say that being said, I have been a little bit surprised how many data scientists in Python I've talked to have not worked with decorators.
976976

@@ -1122,7 +1122,7 @@
11221122

11231123
00:55:37 The libraries and the UIs and all that, yeah.
11241124

1125-
00:55:39 Yeah, so that's really what we've heard is that people, even if they're like totally happy with Shiny for R, they're happy that Shiny for Python exists because they know that if the time comes where they have to add that to their toolkit, that it's an option and they don't have to now try to map everything that they know and take for granted from Shiny to have to map that to Dash or to Streamlet or Panel or something like that.
1125+
00:55:39 Yeah, so that's really what we've heard is that people, even if they're like totally happy with Shiny for R, they're happy that Shiny for Python exists because they know that if the time comes where they have to add that to their toolkit, that it's an option and they don't have to now try to map everything that they know and take for granted from Shiny to have to map that to Dash or to Streamlit or Panel or something like that.
11261126

11271127
00:56:02 >> Yeah. Another example is you work at a university where R is actually really has a good stronghold, especially in the math and statistics department.
11281128

@@ -1267,4 +1267,3 @@
12671267
01:04:02 [Music]
12681268

12691269
01:04:19 (upbeat music)
1270-

0 commit comments

Comments
 (0)