1 00:00:00,490 --> 00:00:03,108 Great, as you may know, we are 2 00:00:03,109 --> 00:00:04,820 approaching the end of the course. 3 00:00:04,821 --> 00:00:08,052 And this one, this is the last section of the course. 4 00:00:08,053 --> 00:00:10,766 We will build your 10th application. 5 00:00:11,410 --> 00:00:13,600 This particular one is special. 6 00:00:14,130 --> 00:00:16,484 The special thing is not about the application 7 00:00:16,485 --> 00:00:20,690 itself, because every application is actually special. 8 00:00:20,691 --> 00:00:22,772 The special thing about this application is 9 00:00:22,773 --> 00:00:25,990 that, you'll build this one independently. 10 00:00:26,500 --> 00:00:29,400 So this is in the form of a project. 11 00:00:30,170 --> 00:00:32,972 You have to build this from scratch. And you 12 00:00:32,973 --> 00:00:35,756 have learned all the skills throughout the course. 13 00:00:35,757 --> 00:00:37,426 So the skills that are required, 14 00:00:37,427 --> 00:00:39,433 to build this particular application. 15 00:00:39,850 --> 00:00:41,888 And in this video, what I wanted to do 16 00:00:41,889 --> 00:00:44,080 is, I want to give you a demonstration of 17 00:00:44,081 --> 00:00:46,832 what this application does and then you can start 18 00:00:46,833 --> 00:00:49,260 building it right away after this video. 19 00:00:49,790 --> 00:00:52,582 Then in the next video, I'll show you the solution. 20 00:00:52,583 --> 00:00:55,396 So I'll show you the code or the video 21 00:00:55,397 --> 00:00:58,292 and explain what the code does and also the 22 00:00:58,293 --> 00:01:01,490 approach, that I use to build the application. 23 00:01:01,491 --> 00:01:04,904 Well now, I could have recorded these videos just as I 24 00:01:04,905 --> 00:01:08,728 did with the other nine applications in the course, but I 25 00:01:08,729 --> 00:01:11,333 really wanted you to do something on your own. 26 00:01:11,688 --> 00:01:14,616 And that will serve you for two things. 27 00:01:14,617 --> 00:01:18,210 One is that you will actually do something independently 28 00:01:18,211 --> 00:01:19,966 and you will learn a lot from that. 29 00:01:20,364 --> 00:01:22,930 And then second, you can use this as a portfolio. 30 00:01:22,931 --> 00:01:28,594 This is quite a nice web application, but this is tough. 31 00:01:28,595 --> 00:01:31,470 I mean, I would be surprised to see anyone 32 00:01:31,471 --> 00:01:35,894 making this work 100%, unless you're a genius. 33 00:01:35,895 --> 00:01:37,648 I really mean that. 34 00:01:37,649 --> 00:01:39,552 But you should be able to make 35 00:01:39,553 --> 00:01:42,733 this work, let's say at around 50%. 36 00:01:43,072 --> 00:01:45,348 If you make it work 50%, then 37 00:01:45,349 --> 00:01:47,348 you have really learned from the course. 38 00:01:47,349 --> 00:01:50,922 So what I mean by 50%, well you may stuck somewhere 39 00:01:50,923 --> 00:01:54,388 and ask for help, maybe you have an error there and 40 00:01:54,389 --> 00:01:58,520 you're not being able to understand it and solve it, for 41 00:01:58,521 --> 00:02:02,280 going forward or you just don't know what to do next. 42 00:02:02,281 --> 00:02:05,240 So in such scenarios, you can step in and 43 00:02:05,241 --> 00:02:07,788 post a question in the Q&A area. 44 00:02:07,789 --> 00:02:10,666 So in the discussion area of the course. 45 00:02:10,800 --> 00:02:15,916 I'll say, don't ask me right away, I mean, I like questions 46 00:02:15,917 --> 00:02:19,166 but it's good for you to solve the problems yourself. 47 00:02:19,966 --> 00:02:22,736 You know, Programming is hard, I mean, 48 00:02:22,737 --> 00:02:26,368 often all you need is a break, like a coffee or a 49 00:02:26,369 --> 00:02:30,480 tea, to just refresh your brain and make it think better. 50 00:02:30,481 --> 00:02:32,692 And then you suddenly may 51 00:02:32,693 --> 00:02:35,492 find yourself cracking that problem. 52 00:02:35,493 --> 00:02:38,308 But if that doesn't work, then I'm here to help you. 53 00:02:38,309 --> 00:02:41,366 Just drop a question and I respond within a day. 54 00:02:41,748 --> 00:02:45,726 And my recommendation try to start from scratch. 55 00:02:45,727 --> 00:02:48,168 Don't look right away at the code or the 56 00:02:48,169 --> 00:02:51,608 lectures, that we have gone through in the course. 57 00:02:51,609 --> 00:02:53,838 Instead of doing that, try to gather 58 00:02:53,839 --> 00:02:56,264 your codes in a sheet of paper. 59 00:02:56,265 --> 00:02:57,708 Write down some steps such as 60 00:02:57,709 --> 00:02:59,938 step one, make the user interface. 61 00:02:59,939 --> 00:03:04,386 Step two, build a script that creates CSV data and generates 62 00:03:04,387 --> 00:03:08,688 an output, and then make the Flask structure and so on, 63 00:03:08,689 --> 00:03:12,064 and then you go and implement these step by step. 64 00:03:12,065 --> 00:03:13,686 If you're stuck, then it's perfectly 65 00:03:13,687 --> 00:03:15,800 okay to look at the resources. 66 00:03:16,133 --> 00:03:17,980 I do it all the time. 67 00:03:19,070 --> 00:03:22,133 Now, what is this application? 68 00:03:23,010 --> 00:03:27,412 Well, this is a Flask application that expects from 69 00:03:27,413 --> 00:03:30,388 the user a CSV file, which should have at 70 00:03:30,389 --> 00:03:33,220 least a column named, a named address. 71 00:03:33,750 --> 00:03:36,966 For example, here is a CSV file. 72 00:03:36,967 --> 00:03:39,133 [No Audio] 73 00:03:39,134 --> 00:03:41,512 And you can see that, we have an Address column in there. 74 00:03:41,513 --> 00:03:44,846 So the user should have a column 75 00:03:44,847 --> 00:03:47,548 called Address, so named Address in there, 76 00:03:47,549 --> 00:03:50,956 either with a lower or uppercase A, it doesn't matter. 77 00:03:50,957 --> 00:03:54,268 So you should build your application to recognize, both 78 00:03:54,269 --> 00:03:58,512 address with lowercase A and Address with uppercase A. 79 00:03:58,513 --> 00:04:02,576 Now, the user can upload such file using 80 00:04:02,577 --> 00:04:06,128 the Choose File button in here, and you 81 00:04:06,129 --> 00:04:10,096 can see that Supermarkets was uploaded in there. 82 00:04:10,097 --> 00:04:14,366 And once the user uploads that file, they'll press Submit 83 00:04:14,367 --> 00:04:17,066 [No Audio] 84 00:04:17,067 --> 00:04:18,959 and this table shows up. 85 00:04:20,529 --> 00:04:23,722 So once the user uploads such a file, the backend 86 00:04:23,723 --> 00:04:27,646 of your application, so Python script will read that file 87 00:04:27,647 --> 00:04:32,792 and it will add a latitude and longitude column, which 88 00:04:32,793 --> 00:04:36,230 are calculated out of the Address column. 89 00:04:36,890 --> 00:04:38,892 So we're talking about geocoding and 90 00:04:38,893 --> 00:04:41,170 you know how to do geocoding. 91 00:04:41,171 --> 00:04:46,170 You learn that in the course, in the Pandas section. 92 00:04:46,171 --> 00:04:49,308 And as you see, the result table is displayed on 93 00:04:49,309 --> 00:04:53,266 the web page, once the user presses the Submit button. 94 00:04:53,630 --> 00:04:56,288 And you can see the two columns in there. 95 00:04:56,289 --> 00:04:58,432 And lastly, you also want to allow 96 00:04:58,433 --> 00:05:01,322 the user to download the CSV version. 97 00:05:01,323 --> 00:05:05,090 So a file that contain this data. 98 00:05:05,091 --> 00:05:08,468 And therefore you need to display a 99 00:05:08,469 --> 00:05:11,860 Download button here, as I did. 100 00:05:11,861 --> 00:05:13,342 So once the user presses 101 00:05:13,343 --> 00:05:16,770 Downloads, a file is downloaded. 102 00:05:18,150 --> 00:05:19,410 This is a file. 103 00:05:20,150 --> 00:05:23,902 We also have some empty cells in there, because Python 104 00:05:23,903 --> 00:05:26,796 was not able, so the geocoding service was not able 105 00:05:26,797 --> 00:05:32,070 to geocode this address to latitude and longitude. 106 00:05:33,690 --> 00:05:36,732 So, yeah, you need to count for that and 107 00:05:36,733 --> 00:05:41,062 just pass some non values to those cells. 108 00:05:41,063 --> 00:05:43,312 Now, soon you may run into problems such 109 00:05:43,313 --> 00:05:47,158 as, if the user uploads some other files, 110 00:05:47,159 --> 00:05:52,308 so let's change this to Add instead of 111 00:05:52,309 --> 00:05:54,400 Address, and I'll save this. 112 00:05:54,401 --> 00:05:57,800 [No Audio] 113 00:05:57,801 --> 00:06:00,933 So I don't have an Address column in that file anymore. 114 00:06:00,934 --> 00:06:06,410 Let me upload it again like that, Submit. 115 00:06:07,070 --> 00:06:09,700 And in this case, you want to show a message 116 00:06:09,701 --> 00:06:12,468 there saying that, Please make sure you have an address 117 00:06:12,469 --> 00:06:15,440 column in your CSV file, or something like that. 118 00:06:15,970 --> 00:06:19,130 So you don't want the program to crash 119 00:06:19,131 --> 00:06:22,088 to show a Flask error in there. 120 00:06:22,089 --> 00:06:23,352 So, yeah, you need to try 121 00:06:23,353 --> 00:06:25,496 and accept some errors in there. 122 00:06:25,497 --> 00:06:30,120 And yeah, that's it. At that point, you have built a geocoding service. 123 00:06:30,121 --> 00:06:32,594 I hope I was clear with the explanations, 124 00:06:32,595 --> 00:06:35,160 but if you have questions, please ask them. 125 00:06:36,010 --> 00:06:38,556 I wish you good luck with this project. 126 00:06:38,557 --> 00:06:40,428 It will be tough but fun, 127 00:06:40,429 --> 00:06:42,146 and it's all about persistence. 128 00:06:42,147 --> 00:06:44,998 So if you commit to doing it, you'll 129 00:06:44,999 --> 00:06:48,976 do it, the next video is dangerous, because 130 00:06:48,977 --> 00:06:50,960 I'll show you the solution in there. 131 00:06:50,961 --> 00:06:54,592 So please watch it as a lost resource, or 132 00:06:54,593 --> 00:06:58,433 watch it to compare your finished application with mine. 133 00:06:58,714 --> 00:07:01,652 And also, when you compare your solution with my 134 00:07:01,653 --> 00:07:04,320 solution, don't expect them to be the same. 135 00:07:05,010 --> 00:07:08,580 They will never be. I mean, there are different ways to make an application 136 00:07:08,581 --> 00:07:12,152 and mine can be better, than yours or the other 137 00:07:12,153 --> 00:07:14,872 way around, so please keep that in mind. 138 00:07:14,873 --> 00:07:17,928 And yeah, that's what I wanted to say, 139 00:07:17,929 --> 00:07:20,328 I hope you enjoyed my course. 140 00:07:20,329 --> 00:07:22,760 I'd also appreciate if you left the review. 141 00:07:22,761 --> 00:07:24,926 I do look at all the reviews 142 00:07:24,927 --> 00:07:27,333 and I appreciate them a lot. 143 00:07:27,750 --> 00:07:31,366 So, yeah, thanks a lot and I'll talk to you later.