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
€65.66
List Price:  €93.80
You save:  €28.14
£56.20
List Price:  £80.29
You save:  £24.09
CA$96.29
List Price:  CA$137.56
You save:  CA$41.27
A$109
List Price:  A$155.72
You save:  A$46.72
S$95.29
List Price:  S$136.13
You save:  S$40.84
HK$548.18
List Price:  HK$783.15
You save:  HK$234.96
CHF 63.57
List Price:  CHF 90.82
You save:  CHF 27.25
NOK kr772.45
List Price:  NOK kr1,103.56
You save:  NOK kr331.10
DKK kr489.98
List Price:  DKK kr700
You save:  DKK kr210.02
NZ$118.75
List Price:  NZ$169.65
You save:  NZ$50.90
د.إ257.05
List Price:  د.إ367.23
You save:  د.إ110.18
৳7,680.95
List Price:  ৳10,973.26
You save:  ৳3,292.30
₹5,842.52
List Price:  ₹8,346.81
You save:  ₹2,504.29
RM334.79
List Price:  RM478.30
You save:  RM143.50
₦90,777.03
List Price:  ₦129,687.03
You save:  ₦38,910
₨19,491.43
List Price:  ₨27,846.09
You save:  ₨8,354.66
฿2,579.37
List Price:  ฿3,684.97
You save:  ฿1,105.60
₺2,281.41
List Price:  ₺3,259.29
You save:  ₺977.88
B$366.88
List Price:  B$524.14
You save:  B$157.26
R1,343.94
List Price:  R1,920
You save:  R576.05
Лв128.54
List Price:  Лв183.64
You save:  Лв55.09
₩96,612.79
List Price:  ₩138,024.19
You save:  ₩41,411.40
₪264.97
List Price:  ₪378.55
You save:  ₪113.57
₱4,029.04
List Price:  ₱5,756.02
You save:  ₱1,726.98
¥10,812.58
List Price:  ¥15,447.20
You save:  ¥4,634.62
MX$1,208.81
List Price:  MX$1,726.94
You save:  MX$518.13
QR256.24
List Price:  QR366.07
You save:  QR109.83
P970.12
List Price:  P1,385.95
You save:  P415.82
KSh9,343.66
List Price:  KSh13,348.66
You save:  KSh4,005
E£3,382.65
List Price:  E£4,832.56
You save:  E£1,449.91
ብር3,997.39
List Price:  ብር5,710.80
You save:  ብር1,713.41
Kz58,507.55
List Price:  Kz83,585.80
You save:  Kz25,078.25
CLP$67,632.73
List Price:  CLP$96,622.33
You save:  CLP$28,989.60
CN¥506.81
List Price:  CN¥724.04
You save:  CN¥217.23
RD$4,150.64
List Price:  RD$5,929.75
You save:  RD$1,779.10
DA9,419.60
List Price:  DA13,457.15
You save:  DA4,037.55
FJ$159.29
List Price:  FJ$227.57
You save:  FJ$68.27
Q546.30
List Price:  Q780.47
You save:  Q234.16
GY$14,650.65
List Price:  GY$20,930.40
You save:  GY$6,279.74
ISK kr9,869.98
List Price:  ISK kr14,100.58
You save:  ISK kr4,230.60
DH711.61
List Price:  DH1,016.63
You save:  DH305.01
L1,253.52
List Price:  L1,790.82
You save:  L537.30
ден4,049.40
List Price:  ден5,785.11
You save:  ден1,735.70
MOP$564.53
List Price:  MOP$806.50
You save:  MOP$241.97
N$1,337.58
List Price:  N$1,910.91
You save:  N$573.33
C$2,584.86
List Price:  C$3,692.82
You save:  C$1,107.95
रु9,352.12
List Price:  रु13,360.74
You save:  रु4,008.62
S/263.28
List Price:  S/376.13
You save:  S/112.85
K266.90
List Price:  K381.31
You save:  K114.40
SAR262.55
List Price:  SAR375.08
You save:  SAR112.53
ZK1,789.88
List Price:  ZK2,557.08
You save:  ZK767.20
L326.78
List Price:  L466.85
You save:  L140.07
Kč1,658.90
List Price:  Kč2,369.96
You save:  Kč711.06
Ft25,921.07
List Price:  Ft37,031.68
You save:  Ft11,110.61
SEK kr766.36
List Price:  SEK kr1,094.85
You save:  SEK kr328.48
ARS$60,874.37
List Price:  ARS$86,967.11
You save:  ARS$26,092.74
Bs485.36
List Price:  Bs693.40
You save:  Bs208.04
COP$272,889.01
List Price:  COP$389,858.15
You save:  COP$116,969.14
₡35,190.72
List Price:  ₡50,274.61
You save:  ₡15,083.89
L1,734
List Price:  L2,477.26
You save:  L743.25
₲519,666.57
List Price:  ₲742,412.64
You save:  ₲222,746.06
$U2,710.62
List Price:  $U3,872.48
You save:  $U1,161.86
zł284.04
List Price:  zł405.79
You save:  zł121.74
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.