Skip to content

Update 450-api-versioning.txt #138

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

Merged
merged 1 commit into from
Mar 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 26 additions & 27 deletions transcripts/450-api-versioning.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

00:00:12 Now what?

00:00:13 That's the conversation I dive into over the next hour with Stanislav Samiv.
00:00:13 That's the conversation I dive into over the next hour with Stanislav Zmiev

00:00:17 We're talking about versioning APIs on this, the 450th episode of Talk Python to Me,

Expand Down Expand Up @@ -214,23 +214,23 @@

00:06:46 But then my other projects, the ones that I maintain, are way cooler.

00:06:50 For example, Bidentic Duality enables you to have multiple versions of your Bidentic models
00:06:50 For example, Pydantic Duality enables you to have multiple versions of your Pydantic models

00:06:57 for almost free in terms of performance and without any code generation.

00:07:02 And CADWIN, the project we're going to be discussing today, implements, I guess, the fullest
00:07:02 And CADWYN, the project we're going to be discussing today, implements, I guess, the fullest

00:07:08 and most sophisticated API versioning paradigm there is at this point.

00:07:12 - Excellent, yeah.

00:07:13 - A lot of cool stuff. - Bidentic Duality looks, yeah, Bidentic Duality looks really, really cool.
00:07:13 - A lot of cool stuff. - Pydantic Duality looks, yeah, Pydantic Duality looks really, really cool.

00:07:17 So a lot of neat stuff here.

00:07:19 A lot of different ways people might know about you.

00:07:21 So yeah, CADWIN's the one we're gonna be focusing on for here.
00:07:21 So yeah, CADWYN's the one we're gonna be focusing on for here.

00:07:25 So let's start with talking about APIs.

Expand Down Expand Up @@ -668,7 +668,7 @@

00:21:20 Visit talkpython.fm/neo4j to get started.

00:21:25 That's talkpython.fm/neo, the number four, and the letter J.
00:21:25 That's talkpython.fm/neo4j, the number four, and the letter J.

00:21:30 Thank you to Neo4j for supporting Talk Python to Me.

Expand Down Expand Up @@ -1208,7 +1208,7 @@

00:38:34 who just wanna learn how to do API versioning, but failed to find any resources.

00:38:39 So Katwin also becomes this, I guess, hub for API versioning resources and anything related to them.
00:38:39 So Cadwyn also becomes this, I guess, hub for API versioning resources and anything related to them.

00:38:46 - It seems like it would probably be pretty easy to adapt to anything that uses Pydantic

Expand Down Expand Up @@ -1276,13 +1276,13 @@

00:40:53 So some good questions, but I think they'll be somewhat answered if we just maybe talk us through your tutorial here.

00:41:02 Like how do we use Kadwin and how does it manifest?
00:41:02 Like how do we use Cadwyn and how does it manifest?

00:41:06 How does it work at runtime?

00:41:07 Stuff like that.

00:41:08 - First, before using Kadwin, you know, you write your regular app, but then you just structure it a little bit differently.
00:41:08 - First, before using Cadwyn, you know, you write your regular app, but then you just structure it a little bit differently.

00:41:13 When you are versioning, you need a directory that you will consider versioned.

Expand Down Expand Up @@ -1314,7 +1314,7 @@

00:42:13 The, if you take a look, we have a versioned API router.

00:42:17 Then you use the Kadwin versioned app.
00:42:17 Then you use the Cadwyn versioned app.

00:42:20 You generate version routers, and then it's going to generate a really nice swagger for them.

Expand All @@ -1336,7 +1336,7 @@

00:42:55 field addresses didn't exist.

00:42:57 - You have a user object, which is a pedantic model.
00:42:57 - You have a user object, which is a pydantic model.

00:43:00 The user object in version, the initial version, just had a field called address, which was a string.

Expand All @@ -1354,7 +1354,7 @@

00:43:30 - You simply describe how do you migrate your schemas?

00:43:32 How do you change your schema classes, your pedantic models?
00:43:32 How do you change your schema classes, your pydantic models?

00:43:36 And then you describe how you convert your requests and response, and that's it.

Expand Down Expand Up @@ -1454,7 +1454,7 @@

00:46:36 Is it passed as a, is the version passed as a header, it's a query string, part of the URL?

00:46:41 - The version is passed as a header and Cadwin by default requires it to be.
00:46:41 - The version is passed as a header and Cadwyn by default requires it to be.

00:46:47 But if you have some developer portal, if you want to store your version in some database,

Expand Down Expand Up @@ -1524,7 +1524,7 @@

00:48:57 And then at some point, use this core to build more Kadwins, you know?

00:49:01 Kadwin Django, Kadwin Flask, whatever.
00:49:01 Cadwyn Django, Kadwin Flask, whatever.

00:49:03 Or it doesn't even have to be a part of Kadwin.

Expand Down Expand Up @@ -1576,11 +1576,11 @@

00:50:52 but they still, most of the time, work with untyped code, which essentially can lead to many errors.

00:50:57 Kadwin tries to make sure that you still work with your schemas, you still know which schema you work with,
00:50:57 Cadwyn tries to make sure that you still work with your schemas, you still know which schema you work with,

00:51:03 it's always the latest.

00:51:05 And Kadwin tries to make sure that you're not going to have any type errors
00:51:05 And Cadwyn tries to make sure that you're not going to have any type errors

00:51:11 if you don't want to, and you're going to have all of the niceties of having this dynamic request response conversion thing.

Expand Down Expand Up @@ -1678,7 +1678,7 @@

00:54:08 It's an amazing library and you don't need anything else.

00:54:12 CADWIN is for use cases where you need to keep a larger number of versions,
00:54:12 CADWYN is for use cases where you need to keep a larger number of versions,

00:54:18 or if the changes between your versions are much trickier.

Expand Down Expand Up @@ -1780,7 +1780,7 @@

00:56:33 And it remains unchanged basically, right?

00:56:35 - Kadwin tries to escape this kind of verbosity.
00:56:35 - Cadwyn tries to escape this kind of verbosity.

00:56:39 And essentially you have all endpoints everywhere.

Expand Down Expand Up @@ -1834,7 +1834,7 @@

00:57:44 You know, before we wrap it up, two quick things, you know, notable PyPI package.

00:57:49 I mean, we've already given Kadwin a shout out.
00:57:49 I mean, we've already given Cadwyn a shout out.

00:57:51 Anything else that like, oh, I came across this and it was super cool.

Expand All @@ -1844,7 +1844,7 @@

00:57:59 - For us in our company, we started using one more package of mine.

00:58:04 It's called ByteTest fixture classes.
00:58:04 It's called PyTest fixture classes.

00:58:06 - Okay. - Essentially, when you are building groups of fixtures that create some objects for you,

Expand All @@ -1854,7 +1854,7 @@

00:58:21 - Yeah.

00:58:22 - A factory fixture pattern that you can see in ByteTest allows you to, you know, make a function within a function
00:58:22 - A factory fixture pattern that you can see in PyTest allows you to, you know, make a function within a function

00:58:29 and one of them is a fixture and that's all cool and nice, but then it's not typed.

Expand All @@ -1864,7 +1864,7 @@

00:58:41 And otherwise you can write a protocol and it's a lot of code.

00:58:45 What ByteTest fixture classes does is it allows you to type everything there.
00:58:45 What PyTest fixture classes does is it allows you to type everything there.

00:58:50 So you write the same amount of code, but it's all typed and now you have,

Expand Down Expand Up @@ -1896,19 +1896,19 @@

00:59:36 only for your internal microservices or only for your front end, then consider using the simple tools.

00:59:44 Consider using the FastAPI versioning, you know, Flask, Raybar, things like that.
00:59:44 Consider using the FastAPI versioning, you know, Flask, Rebar, things like that.

00:59:49 But then once you realize that you need to support versions for months and you need three or more versions

00:59:56 and you're providing your versions as a public, you know, to the public,

01:00:01 then I advise moving straight into CADWIN or CADWIN-like frameworks.
01:00:01 then I advise moving straight into CADWYN or CADWYN-like frameworks.

01:00:06 If you use FastAPI, you can just use CADWIN.
01:00:06 If you use FastAPI, you can just use CADWYN.

01:00:08 It has a bit of a learning curve, but within making one version, you will realize just how simple it is.

01:00:14 And if you're not using CADWIN, that's fine as well.
01:00:14 And if you're not using CADWYN, that's fine as well.

01:00:17 I have all of the resources that I used to build it and all of the resources, you know,

Expand Down Expand Up @@ -1995,4 +1995,3 @@
01:02:25 (upbeat music)

01:02:43 Thank you for watching.