Glossary¶
- Argument¶
A value that is passed to a function. There are two types of arguments:
- Keyword argument
an argument that is preceded by an identifier (for example
name=
) in a function call or that is passed as a value in a dictionary preceded by**
.- Position argument
an argument that is not a keyword argument. Position arguments can be at the beginning of an argument list and/or passed as elements of an iteration preceded by
*
.
assert
¶A keyword that stops code execution if its argument is false.
- Blackbox test¶
is developed without knowledge of the source code. In addition to Unittest, Hypothesis can also be used for such tests in Python.
- build¶
build
is a PEP 517-compatible Python package builder. It offers a CLI for creating packages and a Python API.- Built distribution¶
- bdist¶
A structure of files and metadata that only need to be moved to the correct location on the target system during installation. wheel is such a format, but not distutil’s source distribution, which requires a build step.
- cibuildwheel¶
cibuildwheel is a Python package that builds wheels for all common platforms and Python versions on most CI systems.
See also
- conda¶
Package management tool for the Anaconda distribution. It is specifically aimed at the scientific community, especially Windows, where the installation of binary extensions is often difficult.
Conda does not install packages from PyPI and can only install from the official Continuum repositories or from anaconda.org or local (for example intranet) package servers.
- Continuous Integration¶
- CI¶
Automatic checking of the creation and testing process on different platforms.
- Control flow¶
Time sequence of the individual commands of a computer program.
See also
- Decorator¶
A function that returns another function, usually applied as a function transformation using
@wrapper
syntax. Common examples of decorators are Class methods and Static methods.See also
- devpi¶
devpi is a powerful PyPI-compatible server and PyPI proxy cache with a command line tool to enable packaging, testing and publishing activities.
- Distribution package¶
A versioned archive file containing Python packages, modules and other resource files used to distribute a release.
- distutils¶
Python standard library package that provides support for bootstrapping pip into an existing Python installation or virtual environment.
- Docstring¶
A String methods literal that appears as the first expression in a class, function or module. It is recognised by the Python compiler and included in the
__doc__
attribute of the enclosing class, function or module.See also
- Duck typing¶
Programming style in which the type of an object is not examined to determine whether it has the correct interface, but instead the method or attribute is simply called.
‘If it looks like a duck, swims like a duck, and quacks like a duck, then it probably is a duck.’
By emphasising interfaces rather than specific types, well-designed code improves its flexibility by allowing polymorphic substitution. Duck typing avoids tests with
type
orisinstance()
and typically useshasattr()
tests or EAFP programming instead.See also
- Dummy¶
Object that is passed around but never actually used. Normally dummies are only used to fill parameter lists.
- Dynamic test procedures¶
are used to find errors when executing the source code. A distinction is made between whitebox and blackbox tests.
- EAFP¶
Easier to ask for forgiveness than permission. This common Python style assumes the existence of valid keys or attributes and catches exceptions if this assumption proves false. It is characterised by many try and except statements. This technique is in contrast to the LBYL style, which is common in many other languages such as C.
- Egg¶
A built distribution format introduced by setuptools and now replaced by wheel. For more information, see The Internal Structure of Python Eggs and Python Eggs.
- enscons¶
enscons is a Python packaging tool based on SCons. It builds pip-compatible source distributions and wheels without using distutils or setuptools, including distributions with C extensions. enscons has a different architecture and philosophy than distutils, as it adds Python packaging to a general build system. enscons can help you build sdists and wheels.
except
¶Keyword used to intercept an exception and handle it carefully.
- Exception¶
- Exception handling¶
An exception passes on certain programme states – usually error states – to other programme levels. It is a customisable form of assert.
- F-string¶
String literal preceded by an
f
orF
.- Fake¶
Object that has an implementation that actually works, but usually takes a shortcut that makes it unsuitable for production.
- Flit¶
Flit provides an easy way to create pure Python packages and modules and upload them to the Python Package Index. Flit can generate a configuration file to quickly set up a project, create a source distribution and wheel, and upload them to PyPI.
Flit uses pyproject.toml to configure a project. Flit does not rely on tools like setuptools to create distributions or twine to upload them to PyPI.
- Function¶
A series of instructions that returns a value. It can also be passed zero or more arguments that can be used when executing the main part.
See also
- Garbage collection¶
Process of releasing memory when it is no longer in use.
See also
- Hatch¶
Hatch is a command line tool that can be used to configure and version packages and to specify dependencies. The plugin system allows you to easily extend the functionalities.
- hatchling¶
Build backend of Hatch, which can also be used for publishing on the Python Package Index.
- Import Package¶
A Python module that can contain other modules or recursively other packages.
- Integration test¶
Tests that check whether the different parts of the software work together as expected.
- LBYL¶
Look before you leap. With this style, the preconditions are explicitly checked before the call. This style is in contrast to the EAFP approach and is characterised by the presence of many
if
statements.- maturin¶
Formerly pyo3-pack, is a PEP 621-compatible build tool for binary extensions in Rust.
- meson-python¶
Build backend that uses the Meson build system. It supports a variety of languages, including C, and is able to fulfil the requirements of most complex build configurations.
- Method¶
A function that is defined within a class. If it is called as an attribute of an instance of this class, the method receives the instance object as its first argument (which is normally called
self
).- Mock¶
Objects programmed with exceptions that form a specification of the calls you are likely to receive.
See also
- Module¶
An object that serves as an organisational unit of Python code. Modules have a namespace that contains any Python objects. They are loaded by importing them into Python.
Python modules can exist in two different variants:
- Pure Module
A module written in Python and contained in a single
.py
file (and possibly associated.pyc
and/or.pyo
files).- Extension Module
Usually included in a single dynamically loadable precompiled file, for example a common object file (
.so
).
See also
- multibuild¶
multibuild
is a set of CI scripts for building and testing Python wheels for Linux, macOS and Windows.See also
- Parameter¶
Argument of a function (or method) definition.
See also
- pdm¶
Python package manager with PEP 582 support. It installs and manages packages without the need to create a virtual environment. It also uses pyproject.toml to store project metadata as defined in PEP 621.
- pex¶
Library and tool for creating Python executable (
.pex
) files, which are independent Python environments..pex
files are zip files with #!/usr/bin/env python and a special __main__.py file, which can greatly simplify the deployment of Python applications.Bibliothek und Werkzeug zur Erzeugung von Python Executable (
.pex
)-Dateien, die eigenständige Python-Umgebungen sind. .pex-Dateien sind Zip-Dateien mit#!/usr/bin/env python
und einer speziellen__main__.py
-Datei, die das Deployment von Python-Applikationen stark vereinfachen können.- pip¶
Popular tool for installing Python packages that is included in new versions of Python.
It provides the essential core functions for searching, downloading and installing packages from the Python Package Index and other Python package directories and can be integrated into a variety of development workflows via a CLI.
- pip-tools¶
Set of tools that can keep your builds deterministic and still keep up to date with new versions of your dependencies.
- Pipenv¶
Pipenv bundles Pipfile, pip and virtualenv in a single toolchain. It can automatically import the
requirements.txt
and also check the environment for CVEs using safety. Finally, it also facilitates the uninstallation of packages and their dependencies.- Pipfile¶
- Pipfile.lock¶
Pipfile
andPipfile.lock
are a higher-level, application-orientated alternative to pip’srequirements.txt
file. The PEP 508 Environment Markers are also supported.- pipx¶
pipx helps you to avoid dependency conflicts with other packages installed on the system.
- piwheels¶
Website and underlying software that fetches source distribution packages from PyPI and compiles them into binary wheels optimised for installation on Raspberry Pis.
- poetry¶
An all-in-one solution for pure Python projects. It replaces setuptools, venv/pipenv, pip, wheel and twine. However, it makes some poor default assumptions for libraries and the pyproject.toml configuration is non-standard.
- pybind11¶
This is setuptools, but with a C++ extension and wheels generated by cibuildwheel.
- pypi.org¶
pypi.org is the domain name for the Python Package Index (PyPI). It replaced the old index domain name
pypi.python.org
in 2017. It is supported by warehouse.- pyproject.toml¶
Tool-independent file for specifying projects, which is defined in PEP 518.
See also
- pytest¶
A Python package with test utilities.
See also
- Python Package Index¶
- PyPI¶
pypi.org is the standard package index for the Python community. All Python developers can use and share their distributions.
- Python Packaging Authority¶
- PyPA¶
The Python Packaging Authority is a working group that manages several software projects for the packaging, distribution and installation of Python libraries. However, the goals stated in PyPA Goals were created during the discussions around PEP 516, PEP 517 and PEP 518, which allowed competing workflows with the pyproject.toml-based build system that do not need to be interoperable.
- readme_renderer¶
readme_renderer
is a library that is used to render documentation from markup languages like Markdown or reStructuredText to HTML. You can use it to check whether your package descriptions are displayed correctly on PyPI.- Regression test¶
Tests to protect against new errors or regressions that may occur as a result of new software and updates.
- Release¶
The snapshot of a project at a specific point in time, characterised by a version identifier.
A release can result in several built distributions.
- scikit-build¶
Build system generator for
C
,C++
,Fortran
andCython
extensions that integrates setuptools, wheel and pip. It usesCMake
internally to provide better support for additional compilers, build systems, cross-compilation and finding dependencies and their associated build requirements. To speed up and parallelise the creation of large projects, Ninja can also be installed.- setuptools¶
setuptools are the classic build system, which is very powerful, but with a steep learning curve and high configuration effort. From version 61.0.0, the setuptools also support pyproject.toml files.
- shiv¶
Command line programme for creating Python zip apps as described in PEP 441, but with all additional dependencies.
- Source distribution¶
- sdist¶
A distribution format (usually generated using
python setup.py sdist
).It provides metadata and the essential source files required for installation with a tool such as Pip or for generating built distributions.
- Spack¶
Flexible package manager that supports multiple versions, configurations, platforms and compilers. Any number of versions of packages can coexist on the same system. Spack was developed for the rapid creation of high-performance scientific applications on clusters and supercomputers.
- Static test procedures¶
are used to check the source code, although this is not executed. They are divided into
- Stubs¶
provide ready-made responses to calls made during the test and usually do not react at all to anything that has not been programmed for the test.
- Test-driven development¶
- TDD¶
A software development strategy in which the tests are written before the code.
- trove-classifiers¶
trove classifiers are classifiers that are used in the Python Package Index to systematically describe projects and make them easier to find. On the other hand, they are a package that contains a list of valid and outdated classifiers that can be used for checking.
try
¶A keyword that protects a part of the code that can throw an exception.
- twine¶
Command line programme that transfers programme files and metadata to a web API. This allows Python packages to be uploaded to the Python Package Index.
- uv¶
An extremely fast Python package and project manager written in Rust.
uv greatly simplifies the development and deployment of Python projects:
Testing libraries with different Python versions and tox-uv
- venv¶
Package that is part of the Python standard library from Python ≥ 3.3 and is intended for creating virtual environments.
- Virtual environment¶
An isolated Python environment that allows the installation of packages for a specific application instead of installing them system-wide.
See also
- virtualenv¶
Tool that uses the
path
command line environment variable to create isolated Python virtual environments, similar to venv, but provides additional functionality for configuration, maintenance, duplication and troubleshooting.As of version 20.22.0, virtualenv no longer supports Python versions 2.7, 3.5 and 3.6.
- Warehouse¶
The current code base that drives the Python Package Index (PyPI). It is hosted on pypi.org.
- wheel¶
Distribution format that was introduced with PEP 427. It is intended to replace the Egg format and is supported by current pip installations.
C extensions can be provided as platform-specific wheels for Windows, macOS and Linux on the PyPI. This has the advantage for you that you do not have to compile the package when installing it.
See also
- whey¶
Simple Python wheel builder with automation options for trove-classifiers.
- Whitebox test¶
is developed with knowledge of the source code and the software structure.
Various modules are available in Python:
- Unittest
supports you in the automation of tests.
- Mock
allows you to create and use mock objects.
- Doctest
allows you to test tests written in Python docstrings.
- tox
allows you to test in different environments.
- Zen of Python¶
Listing of Python design principles and philosophies that are helpful for understanding and using the language. The list can be output by entering
import this
.