Rock Solid Python with Python Typing Transcripts
Chapter: Frameworks Built on Typing
Lecture: Setting up the DB to Run the Code Yourself

Login or purchase this course to watch this video and the rest of the course contents.
0:00 If you want to run this example yourself, you have to A, have a MongoDB server that you can talk to.
0:07 MongoDB is free and open source, so it's easy to set up, but you do have to have it set up and running. And then you've got to add the data.
0:15 It'll actually run with no database set up or installed, but it'll have zero interesting things. There'll be zeros all for the user and other stats.
0:24 There'll be an empty list for the recent packages and so on. So I've added this import data markdown and let's look at it in TypePort.
0:32 It looks nicer over there than instead of PyCharm. Over here you can see this course uses custom data from PyPI sources over on pypi.org.
0:43 And it says, here's what you gotta do. You gotta install MongoDB. Here's the steps from the MongoDB people themselves
0:50 based on your platform and your OS and so on, as well as the management tools because the command you're gonna need to run comes from there.
0:58 And then you download the data here. This is the top 5,000 packages at the time when I created them and their data that I got from the IPI.org API.
1:10 And then here's the steps that you go to do them. And then you should see just an output that says, restoring a bunch of tables and you got them.
1:20 Now, I don't believe I added the indexes for that one, but I think over here, let's see.
1:26 Yeah, when you run the code the first time, it'll actually go and create the indexes. So it should run nice and fast.
1:33 But the most important thing is, if you actually want to run this example, you have to have
1:37 MongoDB installed and you have to want anything meaningful to happen, you have to import the data.
1:43 And so from here on out are the steps you got to do to get that data downloaded and imported. Completely optional, right?
1:51 You don't need to actually run this code to appreciate how typing goes from completely the very top to the very bottom of this web application.
2:00 But if you do want to play with it, if you do want to run it, these are the steps import_data.markdown


Talk Python's Mastodon Michael Kennedy's Mastodon