Project 03 - Jobtracker CLI - Building the CLI

Building Command Line Tools with Python, Julia and Nodejs Module 05 - Building CLI Tools - Projects
21 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€67.35
List Price:  €96.21
You save:  €28.86
£55.83
List Price:  £79.77
You save:  £23.93
CA$100.76
List Price:  CA$143.95
You save:  CA$43.19
A$112.23
List Price:  A$160.33
You save:  A$48.10
S$95.14
List Price:  S$135.93
You save:  S$40.78
HK$543.62
List Price:  HK$776.63
You save:  HK$233.01
CHF 63.04
List Price:  CHF 90.06
You save:  CHF 27.02
NOK kr797.48
List Price:  NOK kr1,139.30
You save:  NOK kr341.82
DKK kr502.49
List Price:  DKK kr717.87
You save:  DKK kr215.38
NZ$124.10
List Price:  NZ$177.29
You save:  NZ$53.19
د.إ257.07
List Price:  د.إ367.26
You save:  د.إ110.18
৳8,361.55
List Price:  ৳11,945.58
You save:  ৳3,584.03
₹5,962.79
List Price:  ₹8,518.63
You save:  ₹2,555.84
RM314.04
List Price:  RM448.65
You save:  RM134.61
₦108,335.42
List Price:  ₦154,771.52
You save:  ₦46,436.10
₨19,495.71
List Price:  ₨27,852.21
You save:  ₨8,356.49
฿2,390.81
List Price:  ฿3,415.60
You save:  ฿1,024.78
₺2,467.44
List Price:  ₺3,525.07
You save:  ₺1,057.62
B$434.14
List Price:  B$620.23
You save:  B$186.09
R1,296.68
List Price:  R1,852.48
You save:  R555.80
Лв131.68
List Price:  Лв188.12
You save:  Лв56.44
₩102,198.93
List Price:  ₩146,004.73
You save:  ₩43,805.79
₪256.56
List Price:  ₪366.53
You save:  ₪109.97
₱4,090.81
List Price:  ₱5,844.26
You save:  ₱1,753.45
¥10,994.99
List Price:  ¥15,707.80
You save:  ¥4,712.81
MX$1,408.98
List Price:  MX$2,012.91
You save:  MX$603.93
QR255.09
List Price:  QR364.43
You save:  QR109.34
P967.82
List Price:  P1,382.66
You save:  P414.84
KSh9,046.20
List Price:  KSh12,923.70
You save:  KSh3,877.50
E£3,562.49
List Price:  E£5,089.49
You save:  E£1,527
ብር8,907.19
List Price:  ብር12,725.10
You save:  ብር3,817.91
Kz63,830.88
List Price:  Kz91,190.88
You save:  Kz27,360
CLP$69,323.69
List Price:  CLP$99,038.09
You save:  CLP$29,714.40
CN¥510.80
List Price:  CN¥729.75
You save:  CN¥218.94
RD$4,245.36
List Price:  RD$6,065.06
You save:  RD$1,819.70
DA9,465.07
List Price:  DA13,522.10
You save:  DA4,057.03
FJ$162.39
List Price:  FJ$232
You save:  FJ$69.60
Q539.11
List Price:  Q770.19
You save:  Q231.08
GY$14,638.77
List Price:  GY$20,913.42
You save:  GY$6,274.65
ISK kr9,772.70
List Price:  ISK kr13,961.60
You save:  ISK kr4,188.90
DH703.98
List Price:  DH1,005.73
You save:  DH301.75
L1,291.33
List Price:  L1,844.84
You save:  L553.50
ден4,143.97
List Price:  ден5,920.21
You save:  ден1,776.24
MOP$559.97
List Price:  MOP$800
You save:  MOP$240.02
N$1,289.45
List Price:  N$1,842.15
You save:  N$552.70
C$2,574.80
List Price:  C$3,678.44
You save:  C$1,103.64
रु9,534.71
List Price:  रु13,621.60
You save:  रु4,086.89
S/260.99
List Price:  S/372.86
You save:  S/111.86
K283.85
List Price:  K405.52
You save:  K121.66
SAR262.91
List Price:  SAR375.60
You save:  SAR112.69
ZK1,936.45
List Price:  ZK2,766.47
You save:  ZK830.02
L335.12
List Price:  L478.77
You save:  L143.64
Kč1,694.03
List Price:  Kč2,420.15
You save:  Kč726.12
Ft27,771.44
List Price:  Ft39,675.18
You save:  Ft11,903.74
SEK kr774.38
List Price:  SEK kr1,106.30
You save:  SEK kr331.92
ARS$71,792.58
List Price:  ARS$102,565.23
You save:  ARS$30,772.64
Bs484.55
List Price:  Bs692.24
You save:  Bs207.69
COP$307,165.41
List Price:  COP$438,826.54
You save:  COP$131,661.12
₡35,530.54
List Price:  ₡50,760.09
You save:  ₡15,229.55
L1,777.33
List Price:  L2,539.15
You save:  L761.82
₲546,250
List Price:  ₲780,390.60
You save:  ₲234,140.59
$U3,115.91
List Price:  $U4,451.49
You save:  $U1,335.58
zł287.82
List Price:  zł411.19
You save:  zł123.37
Already have an account? Log In

Transcript

All right, so welcome back again. So in this first class session, we try to see how to build our job tracking CLA that we demoed previously. So let's see how to do it. So I've created another folder called Project three can put it inside the project is to do the same thing. Now let's see how to work with it. Right?

I just want to create a file to touch. They know they forgot to be our job tracker to pi, like this Elijah Bowden, then let's open it to sublime, which is going to be our sublime file. So let's go job tracker. If it is just visual finish, now let's see how to look at it. So first of all, we try to structure our job tracking CLS we put it to know what we are going to be doing. So for this we'll be doing for the purpose of this app will be for tracking jobs right through tracking and then keeping notify keeping notified.

Keep your records rather Have a job that you're applying for. Right. So in case as we let your own case you apply for job from LinkedIn, or indeed any of them want to keep track of Do you want to track them, and then keep records of duty status, you'll be applying for it as it goes as you'd be trying to do. So let's see how our CL is going to be. So first of all, we are going to have our job tracker, then we are going to add a job to compute to add job right in under job, we can be able to do some other stuff. So deep use parameters will need very high in a job that you will need a name, we do need an address for that particular job.

Right. Just SS we also need let's see that particular email, very important. Then we can add server stuff to it. But for now, let's take the title of the job. So let's put as a developer job or something. Then we can also move on to adapt your stats we also need in case you also want to get the model salary very, very potent and kind of to give something like the status right, they stated that you wanted to be which is going to be expended or is not then finally, the job type is a remote job or is a contractual right.

Such an idea So, this is going to be our structure, so, copy this one for this So, we will going to be having the option of adding Joe Biden in our new job we add in the name of the job, the address of the job the email for that particular job the title, the salary will be giving the statistics for you yourself are dispensing whether it is a interviewed or any of them than a job tech whether it is remote, full control, full food, a method full control and this what you're trying to build. That is going to be the face but we can also create another option to not just only add but also to view all jobs. If you don't want to view or jobs Also all types of jobs can also be able to keep that option right there as good as two jobs.

Then the next one is that I should be able to have the option of being able to search for a particular job by a particular card. So this I can search for a job right by car, by by name, by title, by status, all of these things write them so nothing that you need, then you should be able to edit our job in case we make it we make a mistake, we should be able to edit it's going to be job tracker, then edit that particular job price is going to be editing that day job. So how are we going to be editing this you can about how to edit it very interesting. So we have learned how to add how to show how to set how to edit and in case you have applied for a job interview you know Come on, oh, it went on.

Oh yeah. Done. In order to delete it cannot become a job tracker. then delete that job, that particular job that you want. So instead of your stuff to do just no more like this, see, see how you do create, read, update, delete, same thing to add to create, read, show, update, search, edit, delete, right, very interesting. Now let's see how to do this.

So it is going to be our command that we'll be using. So let's see how to work with it is going to uncomment this or not, so that you have it in memory, right. So that's going to be the structure of our CLR. Now let's see how to import packages for lists. Let's make it like this. Keep this one down a different file to this point you have in mind, right?

This is going to be like this input. Click main package. Let's call this one our core packages, call parties. It's going to be important click as a faith because you'll be using to help us build into that you want to do so let's try that one. First I'm going to create my main function to this main function is going to take this particular document of the particular type we're trying to do, which is going to be a job, trucking, jobs, job trucking, and record keeping right or record keeping, I don't know how you can call it record keeping rates very good. That's something simple for 10 seconds great pass.

Then we'll close it with our email as usual. Yeah, easy click to code, we can also use Aqua so in your tenant you have learned to build, then I just come back to the same thing of the click that group to group everything under this cluster, right, that is the basic idea. Now let's create another purchase we'll be creating several functions. So we had four added. So I'll copy this one here. We have Want to add that we have one to show or view.

So we have want to show all jobs, want to view all jobs, which is going to be sure all jobs and this is going to be to view a particular job, right? Very interesting. In the news, we'll have want to search for the job, which is going to be this. So I come back here to already have How is going to be so that when we design it, we just know that is the command. And then by default, in best practice, anytime you are trying to design your API for your CLA, right, you have to make sure that these these things are Bev's right. They are doing stuff they are doing await, at job show this view stuff, right, making it more committed to the user.

Very interesting. So this is starting to try to do so you're creating functions for each and every one of them. So let's create the first function for her Going to be diff ad and that's what job right and then this is going to go with steam that's our job title very simple right? Then I can just go with click that's a cool add I didn't write something like that. I said I have something very busy for that. That's for the adding jobs in case I also want to show stuff I can also create another question for sure.

Oh sure. All kinds of jobs. We want to be sure all jobs for jobs and I can exclude to pass right? They don't you put all of these functions there. Now go with depth for the next one. Show is meant to be view Just want to take our dog spring off view.

So we are done with most of these things. The next one is going to be for such a for such pedagogy passing by that can actually read this one that you are doing Jesse quad, but let's make it to view job right is going to be very interested switch jobs by whatever value that you want by maybe their name by the title by the status as much as you wish you said the previous ones we cannot allow pass. Then last one 100 list, diff edits Joe Come back, let's go with this doc string. And then this one is going to be our edit, job. Pivot, then last is going to be our delete. So depth delete.

To make a delete job or cosmic deleted, go these ones can be redacted. Let's go to the job. Can I just apply to the value of delete, job to pass and the very basics we have need to create all the main functions for our job tracker up to this is the main variable we played and added now to be able to police everything under this case come up to the top of our file here. Then I'll just create in my main dot comment. So by this I mean just come on. I'm committing all these functions into commands right at this point This one here and do it for the rest of this.

This, then I just come back to this, then finale to this. last one's going to be 42. I see what I've done so far. And I come back to my terminal. Right? So let me position it.

All right. So now come to the same place that I have here, my fault, because I run into Python three, then the job tracker does the show. Because you see that you have qualified just a very, very interested to read this little code of importing click and creating individual functions. We together the adult strength, everything to get all our commands. We have our job, the job at a job, says job. Sure job futile.

Very, very interesting. Right? So the big ID. The next option is how do we add a purpose into it? And then how do we add the main features to it? So let's work on it.

I'm just going to come back to this Same thing with click patient option to add our vision to it, right to be adding our vision option to it. So this is just going to be passing in patient 0.01 then all just passing the program name, Prague name is going to be job tracker. That is all nice if I save it and I come back to the same place. Now if I run it, we're going to have our vision information should evasion. Then I can actually division is the division. Like I said we have Joker aka version 0.01, which is the same thing that we are finding here.

That is a basic ID right pianos are both super, very interesting. Now let's see some other cool stuff going to do. I'm going to create our main function. Let's see how to work with the rest, right. So I just come back to this thing. come and find me.

So working for our ad in our job, right, so I'm just going to create the options, the first option is going to be our click that the add in the name option. Now fast enough, that's globally, which is going to be our long form a short form to the long form. And then the short form, right is going to be the name of the company, right? So let's call it as help. I can name it as you wish, but let's use name company, the company and this you're applying for Delica describe the type is going to be string. Right then you have to set the prompt to true because since these things are plenty name, address, email tied to selection, make it as simple and as easy for the user to read.

Where he used short form long form or prompt, it is still going to wait for the pace, right? Very interesting. And that is why it's optional. So that is not a Must matter. But it's still day too early that to be perfect, there's going to be for our option not to pass it here. Right, very simple right?

Now how to create another one for this option, which is going to be option option that I'll pass in the list option which can be our address this as we have above the long format, then Disha Thomas he, right, then I'll just give it help. Then companies address or address company and I'll pass in the same thing, type. Let's close this drink. Let's do then we're going to set the prompts to true that is what we need right. This is the same scenario done above. It has to pass in our address here.

Very interesting. So we have been able to create one something simple now We need to work on the email, the title, the job, the salary. So let's click on the email. So I just copy the same thing here was going to be the same thing for the email, then for the salary for the title, then for the job type, then for the salary. So this is going to be for email. Let's call it an email.

Email company, right? So this is how to eat then this is going to be the other one for the title of their company. That is a joke. It is a ticket, right? It can be any stuff. Let's just title.

This is going to be your job title, right title is a developer. So if I just got a job title for you there for you, right for yourself, the less changes I can make a GT Have you wanted to be dutiful job title, or job type, but let's make it very interesting. Then we as we did this when we need it, we of course, address your personal email, we need to be able to set the particular job that represents job type for a job type here is referring to the particular job displacement dt. It can be remote, it can be full time, I used to let's call this one us job type, job type. then here I can set a choice. So since his job is to restrict them, right to a particular value, I'm just going to be using the clicker choice.

You're going to be computer, click, choice, right click, accept our choice would qualify see in our policy, that's my body. The values that I'm passing are going to be food Type by to the job type can be full time, it can be your mood. That's what most people prefer. So, let's break it here B mood delta B part time then it can also be contract. So, these are the three main job data producing right, they also sit in it very interesting. So that is the idea behind this is closer to the next option that you can own select, I just come back to the same place, then click on an option for the salary.

And then the last one is going to be for status. So this is going to be for salary. salary, right. Language is for salary salary does not is a strength salary must be a, an integer can be a fruit, right. So let's make it as flute. Anyhow you wanted the last one to be our status like it pendant is a job already completed a unissued form of st with a tooth and we thought it was it has to do with his job such status which can be pending, or you know the balance changes one foot also from strength and give it a type right so it's like restricted.

So to be click choice in our passing by restriction. So in this case this is going to be our restriction which is going to be physical will be given to us either pendant right is the job pendant had the job been canceled? Or did you cancel it to cancel or whatever it is successful right success or successful right me that will be taken if you apply for it, in which case we can add as many as you wish to it. Who knows how to work with our option argument now you have to pass in all of these things. Yes, there's going to be our address. So this was named address, we have to take one of them out.

Name, address, email type, title, job type. So low status word right. Now let's make it have address you know, you have to add humor to it. Then this one is going to be our title is going to be a job type. Then this one is going to be For our salary then our status we have passed in all of them the right let's see what I've done so far. Let's try and tackle the first thing we're going to be the name your name, risk old company.

Name is that's exactly si si de to simulate in the past it's actually working. Let's see this data, Come back to our terminal. And now let's run it again with our help. favorites this weekend is not giving us any arrow keys to get for the job. So hard job this does help pay for sushi or now or they often Sodexo name, address, email, title, job type salary, searches for the barbecue. For less Tried so because he brought prompt he brought prompt for all of there must be like a layout we can go without typing the entire stuff.

Basically if I go with the same thing to bring me right so I can just type the name so let's call this because if I pass in the address which is going to be London then email the particular emergency@gmail.com title Elysee developer job type foo. So in this option I can choose let's say it is full time salary so at least passing salary then pendants is very interesting so I didn't job company name is Chico State paraphrase of him to receive the data. Now he has to find a means of storing that data cut is very this session with a command the adding job is variable So how do we store that data? So in the next session, we'll be trying to see how to add some database to give you an option. But to recap, you just import click, you create your click in group, create your individual file shares for adding job for showing or for viewing job for certain jobs, for editing jobs, for deleting jobs, right, something very simple.

Then you created an option format here and you pass them. So let's see the message and how to create or add data, add our data to a database to store our data. Thank you NSE next session, stay blessed.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.