#100DaysOfWeb in Python Transcripts
Chapter: Days 9-12: API Star
Lecture: Day 3 & 4 - Your turn: build your own API
0:00 Congratulations, you made it through day one and two
0:04 watching all the lectures
0:06 and I hope you learned a lot and got inspiration
0:09 to now build your own API.
0:11 So in this module, day 3 and 4
0:13 is really for you to get practice.
0:15 And for day 3 and 4, I suggest you go to a Mockaroo.
0:21 Look through the fake data you can get
0:24 and see if there's any interesting data set
0:27 you can come up with.
0:29 If not, you can look for sites like Kaggle.
0:34 They have a lot of data sets.
0:39 Or you can use our Marvel dataset
0:42 which we used for code challenge some time ago.
0:45 So that's the Marvel character name, appearance, year
0:48 and a bunch of data.
0:50 And if you're not sure how to parse CSV
0:53 we have code for that as well.
0:54 So you can just copy over this code to get it
0:55 into a list of character multiples
0:59 which makes it easy to work with.
1:00 Whatever data set you come up with
1:03 then you're going to create a virtual environment
1:04 and pip install apistar
1:06 just as you saw me doing in a lesson.
1:08 And then you're going to build out the API.
1:11 And here in demo, you have all the code
1:14 that I used in this lesson
1:15 so you can just define your object class
1:17 for the validators and then just copy
1:20 these API methods over and fill them in however you want.
1:24 I mean, the idea is to
1:26 even if you copy code, it doesn't really matter.
1:28 If you practice, you retain so much more.
1:31 And that's the goal of Day 3 and 4.
1:34 Again, Day 4.
1:36 Take an extra day to really flesh out
1:38 the API, implement GET, POST, PUT, DELETE.
1:42 And if you have time left or you want to learn
1:45 a little bit about pytest, I suggest
1:47 to also code some test and again in the demo sub directory.
1:52 You have the test_app.py follow used in the lesson.
1:57 And you can just copy code from here and try it.
2:00 Again, even if you just copy and paste
2:02 and try to modify things, play with it.
2:05 You committed all to muscle memory
2:06 and you might be doing this all
2:08 from memory sooner than you realize.
2:10 All right, so I think that's a good workout.
2:12 And at the end, we would love to hear what you come up with.
2:16 So please do share out your progress.
2:19 Use the #100DaysOfWeb hashtag
2:21 and feel free to include TalkPython
2:23 and PyBites in your tweets.
2:25 Again we are stoked when people put our lessons
2:29 and what they learned from us in practice
2:30 and come up with cool projects.
2:32 Learn a lot, and again, API is are very relevant today.
2:36 It's one of the best web skills you can learn.
2:38 So really make use of this opportunity.
2:40 Good luck.