PLEASE Learn These 4 Python Tools
Skills:
RAG Basics80%
Key Takeaways
The video demonstrates the use of UV, Streamlit, Rich, and Textual tools for efficient Python development, including dependency management, web-based UI creation, and terminal application styling.
Full Transcript
If you're a Python developer, then you need to be using these four tools. Stick around as I give you a high-level introduction to each of them and then jump into a code sample so you can see exactly how they work. And if you like this video, I also have a free developer training that I've linked below that explains my new program Dev Launch. So check that out if it sounds interesting. Anyways, let's get into tool number one, which is UV. Now, if you've written code in Python, I'm sure you've heard of the tool pip. Now, that's the thing that lets you install your favorite libraries like Pygame, NumPy, etc. Well, PIP is good, but UV is just better. UV is a relatively new tool that is 100 times faster than pip and in my opinion significantly easier to use. It does pretty much the exact same thing, but it also manages your Python virtual environments for you. So, it automatically handles dependency tracking, activating the environments, etc. and it makes it really easy to set up projects that have a lot of different dependencies. Anyways, let me show you a quick demo so you can see the value of UV. So, let's look at a laser demo here of UV. So, you can see that I'm inside of a directory, right? I've called it UV demo. Now, what I can do to create a new UV project is just type UV innit and then dot. Now, when I do that, it's going to make a new project inside of this directory. And if we look at the files here, you'll see that it creates a Python version file, a main.py Pi file, a pi project.toml file, and this is where it's actually going to store our dependencies. Now, it's super easy to work with uv. You can just type uv add and then the name of the package you want to install. So maybe something like numpy. When we do that, it installs this super fast, like usually way faster than pip. It gets added into our dependencies and then automatically creates av file here and manages a virtual environment for us. Now, right now, I don't actually need to activate this virtual environment like I might have to do with a traditional virtual environment. What I can do is simply run my code by using the command uv run and then the name of my Python file. So, something like main.py. When I do this, it's automatically going to use this virtual environment to run the Python code for me. So, for example, if I go to main.py here and I import numpy. Okay, let's just run the code now. And I run it. You can see that I don't get an error because it's actually using this Python interpreter, the one that was automatically created by UV to run the code. And then when I import numpy, there's no issue because numpy is actually installed. Of course, there's a lot more things that you can do with UV. But I just find it's very easy to add the packages. I just go UV add and then, you know, maybe mattplot lib or something and then boom, it gets installed, automatically finds all of the other dependencies, adds it to my pipro.toml file. And we also get a lock file so you can lock all of the dependency versions and know exactly what's happening for this particular project. All right, if you want more information on UV, I'm going to leave a video on screen that goes over all of the different features. With that said, let's move on to the next tool. Now, the next tool on my list is not Python related. It's actually called SEO writing, and they're the sponsor of today's video. Now, what if I told you that you could create high converting SEO optimized pages in literally minutes by analyzing what's already working for your top competitors? Well, that's exactly what SEO's writing new super page feature can do. Let me show you what I mean. I just created this top 10 best wireless headphones comparison page using the super page. You can see here I simply entered my keyword, told it I wanted a product roundup, and look at what it generated. We've got detailed product specs, pros and cons, feature tables, and these strategically placed buy now CTAs that are designed to actually convert. This tool analyze the top ranking pages in Google and extracted their winning strategies to build this out. But it's not just for product pages. Check out this local roofing service page that I created for Chicago. Super page automatically included service descriptions, contact information, and even suggested where to place phone call CTAs throughout the page. The AI analyzed what the top local service pages were doing and replicated those conversion elements. The genius here is that Super Page doesn't just create content. It's studying your SER competitors and stealing their best conversion traffic. Now, if you want to try Super Page for yourself, I've got an exclusive 25% discount code where you can use TWWT25 at seioritriting.ai. That link is in the description below. And now, let's get back to our Python tools. So, next on my list here is Streamlit. Again, a newer Python module that lets you make web-based user interfaces with pure Python. Now, since I discovered this, it's been my absolute go-to for spinning up simple Python websites. And it's extremely useful for data science and AI related apps. You don't need any JavaScript, no HTML, no CSS, and you can write three lines of Python code and have a fully functioning UI, which is great, especially for quick demos. Now, it's definitely not something I'd use in production, but it's still extremely useful. And I want to show you a few examples so you can see what it looks like. So, let's have a look at some Streamlit code. So, you can see here that I've imported Streamlit as ST. And I also just brought in pandas and numpy because it's very common to use these with Streamlit. I do some basic stuff. So, I'm setting the page configuration. So, this is the name of the page. For example, I can just add a title. I can add a sidebar. I can show some kind of number inputs. And then I can have some buttons. So, for example, there's a button here called generate. It's as easy as saying, okay, on the sidebar, I want to add a button. And let me show you how we run this code. So, you can see what this 29line file actually looks like. So, if I open up my terminal here, I've already used UV. So, I would have gone UV add and then streamllet, right? So, it installed the package for me. Then I can run the command uvun streamllet run and then the name of my Python file. So, main.py. So whenever you're running with Streamlit, rather than doing, you know, Python and the name of the file, you do Streamlit run and then the name of the file that you want to execute. And because I'm running this with UV, I just put UV before it. So it uses this Python virtual environment. So I'm going to go ahead and press enter. You're going to see that it spins this up now. So I'm just going to go full screen. It's just running localhost on my computer. Let's zoom in a little bit on the sidebar. Let's generate some data. And you can see that we get a graph that we can look at. And we have a table that we can kind of scroll through and we can edit and look at these different values. Obviously, this is a super simple example, but I think it's really cool. Streamlit works very, very well, especially for these data science related type applications and has all of these pre-built components. So, again, 29 lines of code and we now have this working. And Streamlit will also do hot reloading as well. So, anytime you make a change to the Python file, it can automatically reload on the page. Anyways, this is super cool. Definitely check streamlin out if you want a simple UI. And now let's move on to the next tool. Okay, now next on my list, we have a module that I probably install five times a week just because of how often I find myself using it, and that's Python.env. Now, this is an extremely simple yet very powerful module that simply lets you load environment variable files. With just two lines of code, python.env PNV can detect and load environment files in your project's directory and allow you to access the values in your code. And in case you don't know what an environment variable is, it's just a key value pair stored outside of the code that defines configuration settings or system behavior such as things like file paths, API keys, or database credentials. It allows your app to access dynamic values without hard coding them in, and it makes your code more secure and more portable. Anyways, let me show you here. Let's go on to the computer. So let's have a look here at the python.env module. Now first in order for this to make sense I just want to show you that I have this.env file created in my directory. Now this is a convention for storing various credentials. So for example I have this variable called API key. I've just made it equal to five zeros just as a demo here. But a lot of times you have all of these kind of secret values that you just want to be local to your own environment. Now, you want to be able to load these values into your Python script, but by default, Python doesn't really let you do this. So, for example, you can see I'm importing OS and then I'm trying to get this API key variable, which should be this, right, which stored in myv file. But if I just open up my terminal and I just run this by default without using the library I'm going to show you. So, I go Python and then main.py. So, let's run this here. You see that it says my API key is none. It tries to load this API key variable but it can't find it. So that's why we need this python.env module. Now in order to install this story you can go like this. We can type uv init and then dot. We can say uv add and then python.env. Okay. To install the module then I'm going to clear. And now what I can do is simply write these two lines of code. Okay. The ones that I'm on uncommenting here. So we just say from.env import load.env. And then we simply call this load.env function. When we do that, it's going to look for the presence of aenv file in our local directory. If it sees that, it's going to load this as an environment variable that we can then use in our Python script. So now if we go back here and we go uv run and then main.py, you'll see that it actually loads our API key. So obviously that works well, but you can also load various other environment variable files based on the environment you're running in. So a lot of times you might have like a staging.vironment variable file or a dev.environment variable file depending on the environment that your code is running in right staging development production etc. So if you want to specify a particular file to load then you can just go here and say the env path is equal to and then something like staging.env and then in this case it should load the value from staging. So if I run this now you can see the API key changes because in staging that's the value I have here. That's pretty much it. It is stupid simple, but it is so useful. So, I wanted to show you. Okay. Now, the last on my list here are actually two modules that I like to group together, and those are rich and textual. Now, if you've ever seen those really fancy terminal applications and wondered how people are generating those loading animations, colors, fonts, etc., well, they're probably using one of these. Now, both rich and textual allow you to make beautiful terminal applications with advanced configurations, styling, and commands. So, if you're making a command line interface tool, then these are really just a mustuse. Let me show you what they look like and how they work. So, before we can start using rich and textual, we do need to install them. So, I can type uv add rich and then textual like this in a UV project. And then it will add those dependencies for me. Then I'm going to show you a few different demos here of kind of how this works. So the first demo I have is a CPU and memory monitor. So it will kind of in live time update on the screen. You can see that I've imported a bunch of stuff from textual here as well as this PSUIL library which allows me to get things like the CPU percentage virtual memory etc. So if I open this up and I go uv run I believe I called this demo2.py Pi. You can see that we get this nice terminal and it shows you shows me sorry the CPU and memory usage. Then I can press Q and I can quit and get out of that. Okay. Next demo that I have for you here is a simple one where I'm just showing you kind of some different colors on the screen. So same thing. This is from textual. So I can go UV run and then demo3. py. And you can see that we have again a nice terminal. Welcome to the terminal UI built with textual. Next demo I have for you just uses the rich console. So again, just kind of showing you how we can have some different text with different styles. So here I can go UV run and then demo for py. And you can see we get more in the standard uh terminal here these different colors like the purple color, the emoji, the underline, the green, the bold, etc. And you can see how simple it is to use this. It's pretty much just the same command but using console.print. Okay. And kind of creating this text object. Lastly, we have demo five, which is just showing you how to make a loading bar using rich or kind of like a loading spinning animation. So, sometimes you might see that in the terminal and be like, how the heck do I make that? Well, this is how you do it. So, I'm going to go again UV run and then demo 5.py. And you can see it kind of says loading. We have that nice animation still working. And then boom, it stops. Okay, so stupid simple. Just a few lines of code here to get that to work, but makes your terminal applications look so much better. So, that's my list of Python tools that I think every developer needs to be using, mostly because I use them literally every single day. I'd like to hear what Python tools you're using. So, leave a comment down below. And with that said, I look forward to seeing you in another video. [Music]
Original Description
Get a 25% discount using the code TWT25 for SEOWriting at https://seowriting.ai/?utm_source=youtube&utm_medium=tech_with_tim
Want to make real money with coding? I share high-signal insights on careers, monetization, and leverage in my free newsletter. Join here and get my guide How to Make Money With Coding instantly: https://techwithtim.net/newsletter
If you're a Python developer, then you need to be using these four tools. Stick around as I give you a high level introduction to each of them, and then jump into a code sample so you can see exactly how they work.
⏳ Timestamps ⏳
00:00 | Introduction
00:21 | Tool 1 - uv Package Manager
03:00 | SEOWriting
04:32 | Tool 2 - Streamlit
06:56 | Tool 3 - python-dotenv
10:08 | Tool 4 - Rich & Textual
Hashtags
#Python #PythonTools #streamlit
---
I put together some free resources assosiated with this video that you might find useful:
- UV Full Video: https://www.youtube.com/watch?v=6pttmsBSi8M
- Streamlit Course: https://www.youtube.com/watch?v=o8p7uQCGD0U&t=6s
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Tech With Tim · Tech With Tim · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
A* Path Finding Algorithm(Visualization)
Tech With Tim
Python Programming Tutorial #1 - Variables and Data Types
Tech With Tim
Python Programming Tutorial #2 - Basic Operators and Input
Tech With Tim
Python Programming Tutorial #3 - Conditions
Tech With Tim
Python Programming Tutorial #4 - IF/ELIF/ELSE
Tech With Tim
Python Programming Tutorial #5 - Chained Conditionals and Nested Statements
Tech With Tim
Python Programming Tutorial #6 - For Loops
Tech With Tim
Python Programming Tutorial #7 - While Loops
Tech With Tim
Python Programming Tutorial #8 - Lists and Tuples
Tech With Tim
Python Programming Tutorial #9 - Iteration by Item (For Loops Continued...)
Tech With Tim
Python Programming Tutorial #10 - String Methods
Tech With Tim
How to Overclock a NVIDIA GPU
Tech With Tim
Python Programming Tutorial #11 - Slice Operator
Tech With Tim
Python Programming Tutorial #12 - Functions
Tech With Tim
Python Programming Tutorial #13 - How to Read a Text File
Tech With Tim
Python Programming Tutorial #14 - Writing to a Text File
Tech With Tim
Python Programming Tutorial #15 - Using .count() and .find()
Tech With Tim
Python Programming Tutorial #16 - Introduction to Modular Programming
Tech With Tim
Python Programming Tutorial #17 - Optional Parameters
Tech With Tim
Python Programming Tutorial #18 - Try and Except (Python Error Handling)
Tech With Tim
Python Programming Tutorial #19 - Global vs Local Variables
Tech With Tim
Python Programming Tutorial #20 - Classes and Objects
Tech With Tim
Cool VBS Script to Prank Your Friends!
Tech With Tim
How to Overclock an AMD GPU
Tech With Tim
Best GPU'S For Mining Ethereum (2018)
Tech With Tim
Recursion and Memoization Tutorial Python
Tech With Tim
Ethereum Mining Rig - Hardware Guide
Tech With Tim
Pygame Tutorial #1 - Basic Movement and Key Presses
Tech With Tim
How to Install Pygame (Windows 8/10)
Tech With Tim
How to Trade Your Cryptocurrency (Bitcoin, Ethereum etc.) For Cash!
Tech With Tim
How to Mine Ethereum 2018 - WORKING (Super-Easy)
Tech With Tim
Microphone Comparison - $10 Mic vs $150 Mic (Blue Yeti USB)
Tech With Tim
Pygame Tutorial #2 - Jumping and Boundaries
Tech With Tim
Pygame Tutorial #3 - Character Animation & Sprites
Tech With Tim
Pygame Tutorial #4 - Optimization & OOP
Tech With Tim
OBS Studio Tutorial - Best OBS Settings
Tech With Tim
Linear Search Algorithm - Python Example and Code
Tech With Tim
Make Any Mic Sound AMAZING! (WITH OBS)
Tech With Tim
Binary Search Algorithm - Python Example & Code
Tech With Tim
Pygame Tutorial #5 - Projectiles
Tech With Tim
Pygame Game - Mini Golf
Tech With Tim
Pygame Tutorial - Projectile Motion (Part 1)
Tech With Tim
Pygame Tutorial - Projectile Motion (Part 2)
Tech With Tim
Pygame Tutorial #6 - Enemies
Tech With Tim
Pygame Tutorial #7 - Collision and Hit Boxes
Tech With Tim
Pygame Tutorial #8 - Scoring and Health Bars
Tech With Tim
Cloud Mining vs. Hardware Mining - 2018
Tech With Tim
How to Install Pygame on Mac OSX (Fast-Simple)
Tech With Tim
Pygame Tutorial #9 - Sound Effects, Music & More Collision
Tech With Tim
Pygame Tutorial #10 - Finishing Touches & Next Steps
Tech With Tim
How to Fade Your Screen in Pygame [CODE IN DESCRIPTION]
Tech With Tim
How to Create a Button in Pygame [CODE IN DESCRIPTION]
Tech With Tim
Pygame Side-Scroller Tutorial #1 - Scrolling Background/Character Movement
Tech With Tim
Pygame Side-Scroller Tutorial #2 - Random Object Generation
Tech With Tim
Pygame Side-Scroller Tutorial #3 - Collision
Tech With Tim
Pygame Side-Scroller Tutorial #4 - Scoring and End Screen
Tech With Tim
How to Create A Message Box in Python - Tkinter
Tech With Tim
Is Ethereum Mining Still Profitable - Is It Worth It (April 2018)
Tech With Tim
How to Run MAC OSX on a WINDOWS PC (Clover Boot-loader)
Tech With Tim
Programming Problem #1 - Alphabet Soup (Beginner/Novice)
Tech With Tim
More on: RAG Basics
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
Your AI Keeps Making Things Up. RAG Is How You Make It Use Real Facts Instead.
Medium · RAG
Evaluation Metrics for RAG: Measure Retrieval, Generation, and End-to-End Quality With Numbers That…
Medium · AI
Evaluation Metrics for RAG: Measure Retrieval, Generation, and End-to-End Quality With Numbers That…
Medium · Data Science
When Does HyDE Help RAG? I Tested 3 Query Types and It Failed on Two
Medium · AI
Chapters (6)
| Introduction
0:21
| Tool 1 - uv Package Manager
3:00
| SEOWriting
4:32
| Tool 2 - Streamlit
6:56
| Tool 3 - python-dotenv
10:08
| Tool 4 - Rich & Textual
🎓
Tutor Explanation
DeepCamp AI