@@ -8,4 +8,52 @@ subtitle:
88title : Python Packaging
99---
1010
11+ # Introduction
12+
13+ ## What is a Python Package
14+
15+ - A Python package is a toolbox that can be used to perform a variety of tasks.
16+ - A directory with a specific file structure.
17+ - The directory has modules (` .py ` extension).
18+ - Modules allow one to group and structure Python code.
19+ - Modules contain functions and classes.
20+
21+ ## Python Packages are Installable
22+
23+ - Allows one to add functionality within the package's code to any Python environment.
24+ - Packages can then simply be imported (` import numpy ` ).
25+ - Installing a package into an environment enables re-use across projects.
26+ - Structuring code as a package is the first step.
27+
28+ <!-- vale RedHat.TermsWarnings = NO -->
29+
30+ ## Why Create a Python Package {data-menu-title="Why Create a Python Package (i)"}
31+
32+ <!-- vale RedHat.TermsWarnings = YES -->
33+
34+ - Use your code across different projects:
35+ - Allows one to install code into any Python environment.
36+ - Can import functions and classes into any workflow.
37+ - Build community around your code.
38+ - Packages make it easier for others to work on it.
39+ - Version control (` git ` ) makes it easy to track changes and contribute.
40+ - Tools such as issues and pull requests aid outside users to contribute.
41+
42+ ## Why Create a Python Package {data-menu-title="Why Create a Python Package (ii)"}
43+
44+ - Share your code:
45+ - Can be installed on any machine using a single command (` pip ` /` conda ` ).
46+ - Organise your code.
47+ - Packages can help organise large code projects.
48+ - Smaller, more manageable components.
49+ - Structure can help both supporting the codebase and making it easier to understand.
50+
51+ ## What to Consider Before Creating a Package
52+
53+ - Who will use your package?
54+ - How people might use your project?
55+ - If relevant, what data will be used with your package?
56+ - Have you got documentation and tests?
57+ - How long will you be able to support it?
58+
1159{{< include /_ includes/qr-code.qmd >}}
0 commit comments