Skip to content

Commit a7c664c

Browse files
Update 1_intoduction_python_packaging.md
1 parent 0301e08 commit a7c664c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

episodes/1_intoduction_python_packaging.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,23 @@ Standardisation: Packaging is the established method of distributing code via re
3838

3939
Metadata: Packages include project-specific metadata, which is essential for end users.
4040

41+
## Python Package Structure Hierarchy
42+
43+
- Function : A block of reusable code that performs a single specific task.
44+
- Module : A single Python file (.py) that groups related classes, functions and variables.
45+
- Package : A folder/ collection containing multiple modules and an __init__.py file to organize them.
46+
- The __init__.py files are required to make Python treat folders containing the file as packages
47+
- Library : A collection of related packages or modules that provide broad functionality for reuse.
48+
- Library can have Package(s), which can have module(s) which can have function(s). It can also be considered a Project.
49+
- Python package : A Python package is a collection of related code modules (files) bundled with metadata describing how the package should be installed and used [*](https://pydevtools.com/handbook/explanation/what-is-a-python-package/)
50+
51+
```mermaid
52+
graph TD
53+
A[Library/Project<br/>requests] --> B[Package<br/>requests/]
54+
B --> C[Module<br/>api.py]
55+
C --> D[Function<br/>def post]
56+
```
57+
4158
## Steps to create a Python Package :
4259

4360
<img width="1298" height="250" alt="image" src="https://github.com/user-attachments/assets/be6f94ec-599b-4a1e-bd5b-63c2dfad720c" />

0 commit comments

Comments
 (0)