Reuven Lerner's Python Courses/Intro Python: Modules and Packages

  • $180

Intro Python: Modules and Packages

Write less Python code! Learn to use existing module, as well as to write your own. Also: Virtual environments and publishing to PyPI. With more than 4 hours of video and a dozen exercises.

Get this course, and many others, as part of my LernerPython membership, at https://LernerPython.com.

Contents

Introduction and welcome
  • 2 mins
  • 28.2 MB

Section 1: Using modules

In this section, you'll learn how to use Python's "import" statement — what it does, how it searches for modules, and how to use data and functions within those modules.
Section 1 — Using modules.ipynb
  • 52 KB
1. What are modules?
  • 7 mins
  • 23.4 MB
2. Basic importing
  • 7 mins
  • 29.6 MB
03 sys.path
  • 5 mins
  • 111 MB
04 import ... as
  • 4 mins
  • 78.4 MB
05 from .. import
  • 5 mins
  • 106 MB
06 Why from ... import * is bad
  • 5 mins
  • 105 MB
Preview
07 Python's standard library
  • 5 mins
  • 112 MB
08 Exercises 1
  • 3 mins
  • 69.6 MB
exercise-1.txt
  • 805 Bytes
09 Exercise solutions 1
  • 7 mins
  • 150 MB

Section 2: Writing modules

In this section, you'll learn how to write modules. Moreover, you'll learn how Python knows whether it has already imported a module, and how the special __name__ variable allows us to make decisions when our module is imported
Section 2 — Writing modules.ipynb
  • 196 KB
10 The simplest module
  • 7 mins
  • 151 MB
11 Globals, attributes, and reloading
  • 6 mins
  • 132 MB
12 sys.modules
  • 5 mins
  • 96.8 MB
Preview
13 Docstrings
  • 6 mins
  • 140 MB
14 Modules are executed when imported
  • 5 mins
  • 105 MB
15 __name__ and "__main__"
  • 5 mins
  • 114 MB
16 Using __name__ and "__main__"
  • 5 mins
  • 95 MB
17 Mutual imports and __name__
  • 6 mins
  • 130 MB
18 Warnings with names
  • 3 mins
  • 68.2 MB
19 Exercises 2
  • 3 mins
  • 55.7 MB
exercise-2.txt
  • 869 Bytes
20 Exercise 2 solutions
  • 8 mins
  • 184 MB

Section 3: PyPI

In this section, we'll talk about PyPI, the Python Package Archive — how to download and install packages from it, and how to use the site intelligently.

Section 3 — PyPI.ipynb
  • 555 Bytes
21 Intro to PyPI
  • 9 mins
  • 204 MB
22 Installing packages with pip
  • 8 mins
  • 180 MB
23 Trusting PyPI code
  • 5 mins
  • 96.3 MB
24 awesome-python.com
  • 4 mins
  • 73.9 MB
25 Installing into your own directory
  • 3 mins
  • 53.1 MB
26 Versions and upgrading
  • 4 mins
  • 82.3 MB
27 Exercises 3
  • 2 mins
  • 39 MB
exercise-3.txt
  • 323 Bytes
28 Exercise 3 solutions
  • 3 mins
  • 53.1 MB

Section 4: Virtual environments

In this section, we'll talk about virtual environments, which ensure that each of our projects has its own, separate list of installed packages.
29 Intro to virtual environments
  • 6 mins
  • 146 MB
30 Creating virtual environments
  • 5 mins
  • 117 MB
31 Activating and deactivating venvs
  • 8 mins
  • 172 MB
32 Generating and using a requirements.txt file
  • 5 mins
  • 106 MB
33 Exercises 4
  • 3 mins
  • 50.2 MB
exercise-4.txt
  • 683 Bytes
34 Exercise 4 solutions
  • 6 mins
  • 132 MB

Section 5: Packages

In this section, we'll learn about Python's "packages," which allow us to create collections of modules for easier maintenance and distribution.
Section 5 — Packages.ipynb
  • 30.9 KB
35 Packages
  • 8 mins
  • 178 MB
36 More complex package hierarchies
  • 7 mins
  • 162 MB
37 __init__.py files
  • 5 mins
  • 109 MB
38 Hierarchies and relative imports
  • 13 mins
  • 284 MB
39 Exercises 5
  • 2 mins
  • 31.1 MB
exercise-5.txt
  • 771 Bytes
40 Exercise solutions 5
  • 6 mins
  • 120 MB

Section 6: Advanced topics

In this section, we'll discuss a few more advanced topics regarding modules and packages — things that you don't necessarily need to know, but which will really come in handy.
Section 6 — Advanced topics.ipynb
  • 170 KB
41 sys.modules
  • 8 mins
  • 173 MB
42 __all__
  • 5 mins
  • 98.5 MB
43 .pyc files
  • 9 mins
  • 210 MB
44 Defined dunder names in modules and packages
  • 6 mins
  • 136 MB

Section 7: Distributions

In this section, we get a taste of how to publish own own packages to PyPI. I use "Poetry" in this section, and both develop and publish a package of my own.
45 Packages vs. distributions
  • 5 mins
  • 180 MB
46 Installing manually with setup.py files
  • 7 mins
  • 152 MB
47 Wheelfiles
  • 9 mins
  • 200 MB
48 Introduction to Poetry
  • 7 mins
  • 141 MB
49 Creating a distribution
  • 10 mins
  • 221 MB
50 Publishing to PyPI
  • 5 mins
  • 99.7 MB
51 Dependencies with Poetry
  • 8 mins
  • 177 MB
52 Conclusion
  • 2 mins
  • 55 MB