Package
A distributable collection of software files and metadata that can be installed or reused.
What is it?
A package groups related code so it can be reused and distributed.
Backend projects often depend on packages created by other developers or teams.
Simple Definition: A package is reusable code bundled together.
Think of it like...
Think of a toolbox.
Instead of building every tool yourself, you install a package and use the tools it provides.
What does it do?
Packages can provide:
Database Drivers
HTTP Clients
Validation Tools
Logging Tools
Utility Functions
Where is it used?
Packages are used in:
Example
Python package: fastapi
Install
pip install fastapiUse
from fastapi import FastAPIHow it connects
A package moves from a repository into the project environment, then becomes available to application code.
Do Not Confuse
Package
A collection of related code that may contain multiple modules.
Module
A single code file or logical unit.
Package ≠ Module
Topic Glossary
| ENGLISH TERM | 中文 | SIMPLE ENGLISH | 中文小白理解 |
|---|---|---|---|
| Package | 软件包 | A reusable collection of code. | 打包在一起、可以安装并重复使用的一组代码。 |
| Module | 模块 | A unit of code that can be imported. | 可以被其他代码导入使用的一块程序。 |
| pip | Python 包管理工具 | A tool commonly used to install Python packages. | Python 中常用来下载安装第三方软件包的工具。 |
| Install | 安装 | Adding a package to an environment. | 把某个软件包加入当前项目运行环境。 |
| Import | 导入 | Making code from another module or package available. | 在程序中引用另一个模块或软件包的代码。 |
| Dependency | 依赖 | A package or component required by the project. | 项目运行时需要使用的软件包或组件。 |
What to Remember
Packages bundle reusable code.
Backend projects often depend on external packages.
Packages are installed into an environment and imported into code.