You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Being able to easily reuse in multiple workflows on your computer
7
+
* Being able to share your code with others who may find the functionality useful.
8
+
* Being able to better organize code that needs to be reused.
9
+
10
+
11
+
The first step in creating a Python package is turning that
12
+
code into a Python package that is pip installable.
13
+
The package that you create in this lesson will have
14
+
the bare minimum elements that you need to install a package.
15
+
16
+
In upcoming lessons you will learn how to:
17
+
* add a **README** file to support community use of your package
18
+
* add package metadata in a **pyproject.toml** file to support publication to PyPI
6
19
7
20
<!--
8
21
TODO: is it clear where to add commands? bash vs. python console
@@ -11,11 +24,12 @@ Bash vs zsh is different
11
24
does this work on windows and mac? i know it works on mac/linux
12
25
-->
13
26
14
-
:::{figure-md} code-to-script
27
+
:::{figure-md} code-to-python-package
28
+
29
+
<imgsrc="../images/tutorials/code-to-python-package.png"alt="Diagram showing the basic steps to creating an installable package. There are 4 boxes with arrows pointing towards the right. The boxes read, your code, create package structure, add metadata to pyproject.toml and pip install package."width="700px">
15
30
16
-
<imgsrc="../images/tutorials/code-to-script-diagram.png"alt="Diagram showing the basic steps to creating an installable package. There are 4 boxes with arrows pointing towards the right. The boxes read, your code, create package structure, add metadata to pyproject.toml and pip install package."width="700px">
31
+
A basic installable package needs a few things: code, a [specific package file structure](https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-structure.html) and a `pyproject.toml` containing your package's name and version. Once you have these items in the correct directory structure, you can pip install your package into any environment on your computer.
17
32
18
-
A basic installable package needs a few things: code, a specific package structure and a `pyproject.toml` containing your package's name and version. Once you have these items in the correct directory structure, you can pip install your package into any environment on your computer.
19
33
:::
20
34
21
35
:::{admonition} Learning Objectives
@@ -33,7 +47,7 @@ environment. You are welcome to use any environment manager that you choose.
33
47
34
48
*[If you need guidance creating a Python environment, review this lesson](extras/1-create-environment.md) which walks you through creating an environment using both `venv` and `conda`.
35
49
* If you aren't sure which environment manager to use and
36
-
you are a scientist, we suggest that you use `conda`.
50
+
you are a scientist, we suggest that you use `conda`, particularly if you are working with any sort of spatial data.
0 commit comments