1
00:00:05,410 --> 00:00:09,730
Welcome everyone to the section on modules and packages in this lecture.

2
00:00:09,730 --> 00:00:12,440
Don't start off by talking about pipeline with Pip.

3
00:00:12,470 --> 00:00:16,380
Install Type-I is a repository for open source.

4
00:00:16,380 --> 00:00:18,230
Third party Python packages.

5
00:00:18,330 --> 00:00:22,550
And if you've worked of other programming languages it's similar to Ruby gen's in the Ruby world.

6
00:00:22,560 --> 00:00:26,430
PH packages CPM for Perl and NPM for notes.

7
00:00:26,480 --> 00:00:33,060
Yes so far we've really only use libraries that come internally of python and these are known as the

8
00:00:33,060 --> 00:00:36,500
standard library or the built in libraries for Python.

9
00:00:36,810 --> 00:00:39,450
Things like the math library.

10
00:00:39,450 --> 00:00:43,740
Now there are many other libraries available that people have open source and shared on Type-I And these

11
00:00:43,740 --> 00:00:49,620
are also called packages and we can use Pipp install at the command line to install these external packages.

12
00:00:50,490 --> 00:00:56,190
By installing Python from Python or or by installing the Anaconda's distribution as shown earlier in

13
00:00:56,190 --> 00:00:58,350
this course you actually have already installed.

14
00:00:58,350 --> 00:01:05,390
Pip Pip is a simple way to download packages at your command line directly from the pipe repository.

15
00:01:05,580 --> 00:01:08,910
Now there are packages already created for almost any use case you can think of.

16
00:01:08,910 --> 00:01:14,820
Python is a hugely popular language and it's growing very quickly so that means if you ever want to

17
00:01:14,820 --> 00:01:20,650
work with Python with some other external use case maybe you want to make web development of Python

18
00:01:20,730 --> 00:01:25,650
so you would Google around and eventually discover that there's libraries such as Django or Flast for

19
00:01:25,650 --> 00:01:31,200
web development of Python or maybe have a more specific use case like working with PDSA of Python or

20
00:01:31,200 --> 00:01:33,920
working with Excel documentation with Python.

21
00:01:33,990 --> 00:01:38,160
In that case you can always do a quick Google search and almost always the links that come up first

22
00:01:38,220 --> 00:01:43,650
are either at the pipe pipe page for the package or the package documentation and will show you a little

23
00:01:43,650 --> 00:01:46,540
exercise of what a good google search looks like.

24
00:01:47,700 --> 00:01:52,080
So we're going to quickly do now is show you how to download and install external packages to do this

25
00:01:52,140 --> 00:01:53,280
will open up our browser.

26
00:01:53,290 --> 00:01:55,510
But we're also going to keep working at our command line.

27
00:01:55,710 --> 00:01:59,090
So remember for Windows users that means open up your command prompt.

28
00:01:59,280 --> 00:02:02,190
And for Mac OS and Linux users that means open up your terminal.

29
00:02:02,190 --> 00:02:05,320
So let's have a browser open along with our command prompt.

30
00:02:05,520 --> 00:02:12,060
OK so here I am at my command line and let's show you how to install a package that's hosted on Type-I

31
00:02:12,480 --> 00:02:14,000
something you do need to be aware of.

32
00:02:14,040 --> 00:02:18,840
Is that your firewall may block Pipp from accessing the Internet.

33
00:02:19,020 --> 00:02:23,580
So if you're on a work network or you're on a work computer you don't have full admin permissions you

34
00:02:23,580 --> 00:02:26,470
may need to check that or talk to your network administrator.

35
00:02:26,850 --> 00:02:28,500
But let's move on.

36
00:02:28,500 --> 00:02:29,450
And we're all going to do.

37
00:02:29,520 --> 00:02:36,610
Here is type p p install space and then here's where you would actually put in your package name.

38
00:02:36,660 --> 00:02:38,590
So there are a ton of packages out there.

39
00:02:38,760 --> 00:02:43,140
We're going to start with a package that you may already have installed because you've installed Anaconda

40
00:02:43,390 --> 00:02:48,870
and that's the request package which allows you to request information from web sites online.

41
00:02:48,930 --> 00:02:52,030
So this is just a general syntax of how you would download a package.

42
00:02:52,110 --> 00:02:57,840
Notice here I'm typing this directly into the command line or directly onto my terminal or command prompt

43
00:02:57,910 --> 00:02:59,700
and not actually calling Python first.

44
00:02:59,760 --> 00:03:06,330
Is a command line utility so you hit enter here and you may get the requirement already satisfied.

45
00:03:06,480 --> 00:03:10,510
Most likely if you install the anaconda you already have requests installed.

46
00:03:10,710 --> 00:03:12,970
So this is what it looks like when you already have it.

47
00:03:13,440 --> 00:03:17,960
What I'm going through now is a library that you most likely do not have yet.

48
00:03:18,060 --> 00:03:24,360
And that's the color Ramah library and it is just a bit of a silly library that allows you to print

49
00:03:24,420 --> 00:03:28,280
out colorize text at your command prompt or at your terminal.

50
00:03:28,440 --> 00:03:30,360
So type Pipp install Kalorama.

51
00:03:30,370 --> 00:03:31,640
Notice the spelling here.

52
00:03:31,890 --> 00:03:39,760
Enter And we actually already have an install because I ran this line already so we're going to do now

53
00:03:40,000 --> 00:03:44,910
is run the actual Colorada external package that we just installed.

54
00:03:45,160 --> 00:03:51,420
So what I'm going to do now is type python and let's try checking out Colorada.

55
00:03:51,510 --> 00:03:53,610
So to do this it's actually quite simple.

56
00:03:53,850 --> 00:04:03,300
All it needs to do is say from color Rahma import in it and then on the next line call in it.

57
00:04:03,300 --> 00:04:08,670
So basically is a bit of an initialization function that allows you to set up depending on what platform

58
00:04:08,670 --> 00:04:17,310
you're using and then what we can do is say from color Ramah import and what we're going to do here

59
00:04:17,310 --> 00:04:19,890
is say import for.

60
00:04:19,920 --> 00:04:26,260
So that's capital F O R E which stands for foreground and then I will create a print statement that

61
00:04:26,260 --> 00:04:29,030
says for Dot.

62
00:04:29,060 --> 00:04:40,060
And then in all caps read plus and I will just say some read text and then hit enter.

63
00:04:40,190 --> 00:04:48,230
And now you see I have a text and we can do that for a variety of colors so I can say now print for

64
00:04:49,480 --> 00:04:57,600
green plus switch to green and now it's green.

65
00:04:57,600 --> 00:05:03,240
So again just a very simple library that allows you to incorporate color directly at your command line.

66
00:05:03,240 --> 00:05:07,080
This is not a library we will ever really be using again but it's just something fun that you can play

67
00:05:07,080 --> 00:05:11,660
with and you can check out the doc documentation simply by Google searching Colorada.

68
00:05:11,820 --> 00:05:12,730
What I want to show you now.

69
00:05:12,780 --> 00:05:15,270
Let me quit out of this Python session.

70
00:05:15,280 --> 00:05:20,430
Show you how you would actually create a Google search and what kind of things to expect to pop up when

71
00:05:20,430 --> 00:05:24,120
you are looking for an external package that you may not know ahead of time.

72
00:05:24,120 --> 00:05:29,520
So for example let's try to solve the problem of trying to work Excel files in Python and figure out

73
00:05:29,520 --> 00:05:31,550
a package that allows us to do that.

74
00:05:31,560 --> 00:05:35,560
So we are looking for a Python package for any particular workflow.

75
00:05:35,700 --> 00:05:40,620
It's always best to just a simple Google search and I know hopefully this is pretty obvious but a lot

76
00:05:40,620 --> 00:05:45,130
of times the best thing to do and pretty much everybody does this no matter how experienced developer

77
00:05:45,160 --> 00:05:49,380
or they are is it just google search Python package for and then whatever they're looking for whether

78
00:05:49,380 --> 00:05:55,350
it's Excel for PDA apps and you should always end up seeing the top results some sort of link to helpful

79
00:05:55,350 --> 00:05:56,610
information.

80
00:05:56,640 --> 00:05:58,910
So start off with the example for Excel.

81
00:05:59,310 --> 00:06:05,190
And as we scroll down we'll eventually see Python excel or and if you click on that link it actually

82
00:06:05,310 --> 00:06:07,990
reports back a bunch of packages that are available.

83
00:06:08,190 --> 00:06:14,040
Open my Excel excel or the execute tills a ton of stuff that you can play around with.

84
00:06:14,040 --> 00:06:18,650
So then we end up doing is you either go to the documentation or you go straight to the download link.

85
00:06:18,900 --> 00:06:23,550
And typically when you go to the download link it takes you to the Python software foundation Web site

86
00:06:23,550 --> 00:06:24,320
for pipeline.

87
00:06:24,360 --> 00:06:26,690
So why Python python.

88
00:06:27,080 --> 00:06:34,020
And here's just official information about the actual package depending on how big the packages if it

89
00:06:34,020 --> 00:06:34,950
has more users.

90
00:06:34,950 --> 00:06:39,390
It almost always has a separate documentation page and the documentation will be linked somewhere in

91
00:06:39,390 --> 00:06:43,740
the top few lines so you click here and pipe Packer's documentation and it will take you to the official

92
00:06:43,740 --> 00:06:47,470
documentation for that actual package.

93
00:06:47,640 --> 00:06:51,460
And a lot of times they're hosted by read the docs thought I know.

94
00:06:51,480 --> 00:06:56,400
So now here we see some nice documentation and all we can do is figure out how to install it from this

95
00:06:56,400 --> 00:06:57,230
documentation.

96
00:06:57,300 --> 00:07:00,790
Or typically we end up realizing it's it's always just typin stall.

97
00:07:00,810 --> 00:07:02,750
And then the name of the actual package.

98
00:07:02,850 --> 00:07:04,780
So we know that it's open Pikesville.

99
00:07:04,980 --> 00:07:07,130
Let's now go back to our command line install it.

100
00:07:07,320 --> 00:07:16,050
So then here back or our command line we're going to do is say Pipp install open pie Excel enter and

101
00:07:16,200 --> 00:07:21,240
I've actually already run this before but that's how you would install a package from the internet from

102
00:07:21,240 --> 00:07:27,250
pipe pipe and then later on you could call it Python and then you should be able to import open pie

103
00:07:27,250 --> 00:07:29,520
excel with no issues.

104
00:07:30,590 --> 00:07:35,840
That's the basics of using Pipp install with Python and figuring out what external packages are a good

105
00:07:35,840 --> 00:07:36,800
fit for you.

106
00:07:36,800 --> 00:07:37,720
Hope those are useful.

107
00:07:37,750 --> 00:07:40,370
If you have any questions feel free to post the Q&amp;A forms.

108
00:07:40,370 --> 00:07:44,950
Coming up next we're going to learn how to create our own modules and packages using Python.

109
00:07:44,960 --> 00:07:45,580
We'll see if there.
