0:02 okay I am really excited for this video
0:04 getting to build with python different
0:06 scripts to automate my life sounds like
0:08 a really good idea there's so much in my
0:09 life that I can automate and I'm going
0:12 to share with you today some really cool
0:13 and honestly really simple python
0:16 projects that you can build to automate
0:17 your life but not only are these scripts
0:18 really interesting for actually
0:20 automating your life and doing really
0:22 cool stuff but it's a great way to show
0:24 potential and future employers different
0:26 projects or things that you are working
0:28 on a lot of these scripts can really be
0:30 built out into quite large projects that
0:32 you can make around them push them to
0:33 your GitHub show you are constantly
0:36 building and it's just a really fun
0:38 thing to do okay let's get started oh
0:40 wait make sure to hit that subscribe
0:41 button for more Tech coding career
0:43 related videos leave in the comments
0:46 other videos you want to see and let's
0:48 get to it
0:50 where are we going we're not going too far
0:55 before we get into it though I want to
0:57 say a big thank you to Intel and their
0:58 one API tools and libraries for
1:00 sponsoring this video this is across
1:02 architecture developers Dream Suite
1:04 making it easy to port code between
1:06 platforms and even providing a certain
1:09 level of future proofing this is a great
1:11 tool for devs working with AI Internet
1:15 of Things cloud and so much more one API
1:17 is not only a huge benefit for your
1:19 toolkit but also it saves a ton of time
1:21 I link them down below so make sure to
1:23 go check them out for more details and
1:25 to start building with them foreign
1:27 foreign
1:28 something I've been wanting to build for
1:31 a while is a script that will take a PDF
1:32 and turn it into an audio file
1:34 oftentimes if I'm studying or learning
1:36 something new and it's in PDF format and
1:38 I have to spend so much time reading it
1:40 I would prefer to just be listening to
1:42 it so I built a script with python that
1:44 will take any PDF and convert it into an
1:46 audio file let's get building first
1:48 thing we are going to be building as I
1:51 mentioned is turning a PDF into an MP3
1:54 file and this is super simple there's
1:55 two packages required but before we get
1:57 into it last time I made a python
1:59 project I got a lot of questions around
2:01 setting up the project in Python because
2:04 last time we used replit this time we
2:05 are in vs code so I'm going to share
2:08 with you a few commands to a ensure you
2:10 are installed python is installed and
2:12 really how to get your virtual
2:13 environment running first thing we need
2:15 to do is check that you have python
2:17 installed or what python version you
2:19 have and of course if you don't have
2:21 python installed pause this video and go
2:22 install it we're not going to do that in
2:25 this video because it's pretty Excel
2:26 explanatory online
2:28 all right so you can see I have python
2:32 3.9.10 installed then what we need to do
2:34 is get our virtual environment up and
2:36 running so
2:38 first of all you can see um in the
2:39 project I already have it up and running
2:42 but just to show you what I did so type
2:52 it's not not there
2:54 okay so now you can see we are in our
2:55 virtual environment
2:57 next up we need to install these two
3:01 packages so we go and once again I am
3:04 the worst seller on the planet so let me
3:06 just copy this command I've written down
3:11 install and p y t t x x
3:14 three and this is actually a module that
3:16 is a text to speech conversion library
3:19 in Python and this is going to be a huge
3:22 help in getting us to convert our text
3:24 into speech go
3:25 go
3:28 next up we need to install
3:37 and I already installed this as well but
3:38 I just want to go through the process
3:40 with you to ensure you understand
3:42 and this one here that we just installed
3:44 is a python Library used for performing
3:47 major tasks on PDF files and in this
3:50 case we have a book PDF so any PDF you
3:52 want to turn into audio put it in your
3:54 project directory okay now let's get
3:57 into some coding the fun part
3:59 so first of all what we need to do is
4:01 open the PDF so let's call this PDF reader
4:04 reader
4:07 I told you we can't spell today and then
4:22 [Music]
4:24 and here we are going to pass in the PDF
4:31 foreign
4:34 we need to initiate speaker
5:05 [Music] foreign
5:07 foreign [Music]
5:21 text
5:33 [Music] foreign
5:45 then we want to actually take that
5:48 speaker and save it to file to save it
5:52 as an MP3 I pass in the clean text
5:55 and what do we now we pass and whatever
5:57 we want to call is MP3 file I'm going to
5:58 call it story
6:00 story time
6:01 time [Music]
6:10 then we stop it
6:17 [Music]
6:19 here we go we can see printed printed
6:23 out text and we have our MP3 this is
6:24 really simple it's really fun easy
6:27 project I need two modules from Python
6:29 and it's a really
6:32 really simple thing to build but you can
6:34 imagine how powerful it can get when you
6:37 are using large PDFs if you want
6:39 specific Pages there's so much you can
6:41 play around with this so I will link all
6:43 the code below and I really encourage
6:46 you to uh really take this clone this
6:48 and build on top of it build a really
6:50 cool project and it really shows
6:52 initiative when you are pushing things
6:53 to GitHub that you're building things
6:56 like this and expanding on them and also
6:58 too when you are looking for uh future
7:01 drafts okay project two this is a big
7:02 one I'm not even going to show you if
7:04 you've seen past videos you've seen my
7:06 desktop folder or my desktop and it's a
7:10 disaster equally as bad if even worse is
7:11 actually my downloads folder so I wanted
7:13 to build a python script that we could
7:15 actually use to clean out my downloads
7:16 folder and for this I wanted to be
7:18 specific into which file formats I
7:21 wanted to be able to delete let's get
7:23 into it okay project number two that we
7:25 are going to be doing is being able to
7:27 access our downloads folder and then
7:29 delete specific files from that folder
7:31 and this is something that I'm sure
7:34 you've all had the instances of where
7:36 your downloads folder is just kind of
7:38 out of control for this I'm going to do
7:40 it that it deletes specific files but
7:42 you could also really add on to this so
7:45 it's for the entire downloads folder or
7:47 different extensions but I really wanted
7:49 to do this is the base you can build
7:51 upon it and I'm not going to go through
7:54 again the showing you how to start the
7:55 virtual environment I'm assuming that
7:57 you have done that from the previous
7:59 project first thing we need to do is
8:02 import and install the OS module which
8:04 really gives us access to our operating
8:07 system then we need to give a file path
8:11 that we want to access and in this case
8:14 there's construction going on
8:16 and in this case we are going to be
8:19 accessing our downloads
8:23 so replace Tiffany Jansen with your name
8:32 [Music]
8:50 the file path exists let's remove it and
8:58 successfully being deleted
9:03 ah delete Ted okay there we go and then else
9:14 oh it's really annoying that I did one
9:18 with one quote and everything um
9:24 okay so we have a file path here as you
9:25 can see but we need to give it a
9:28 specific file so let me go my downloads
9:30 folder I am not going to show you this
9:31 folder because it's a disaster this is
9:34 why we are doing this and one file that
9:47 two dogs surgery but once again you
9:49 could we could replace this and make it
9:51 Dynamic to delete all PDFs or delete
9:53 everything in the downloads folder I
9:54 just wanted to start small to show you
9:56 this also if you didn't catch it from
9:59 last time a simple way to run a python
10:02 in your terminal is right click and then
10:03 I was like right or left click right
10:05 click and then go run python file and
10:09 terminal should get successfully deleted
10:12 this file has successfully been deleted
10:14 yay but then if I was to run it again
10:16 because now it doesn't exist it should
10:22 there you have it those are two really
10:24 small but fun things to do think of
10:25 different ways that you could even put
10:27 these together and it's really just
10:29 playing around with different modules in
10:31 Python doing some kind of conditional
10:34 statements and um whatnot but it's such
10:36 a fun way to think of different projects
10:39 to build and expand upon so I linked my
10:40 GitHub down below which will feature
10:43 both of these and okay
10:45 we've done our work here
10:47 okay we have built some really cool
10:49 scripts if you ask me I'm curious to
10:50 know what else should we automate what
10:53 should we automate next leave down in
10:54 the comments and let's continue building
10:56 together I link the projects down below
10:58 too so make sure to go check them out
11:01 build them then build on top of them
11:03 like I said it's a great way to add to
11:06 your portfolio to contribute to you know
11:08 bulk up your GitHub all of that okay you
11:10 can see the sun is out
11:11 it's time to go enjoy the weekend bye everyone