Skip to content

What is a Python application?

A Python application is software users run to perform a task, such as a web service, command-line tool, data pipeline, or desktop program.

A library provides code for other programs to use. Django is a library; a Django-powered website is an application. Both may contain import packages, and both can be delivered as installable distributions. Packaging describes how code is organized or delivered, not whether it is an application.

A project can serve both roles. A command-line tool may also expose functions that other programs import. The useful distinction for dependency management is who chooses the environment: the application deployer or the library’s consumer.

Separate compatibility requirements from deployment choices

A library declares the dependency versions it supports in its distribution metadata. Version ranges let an installer select versions compatible with the other libraries in the consumer’s environment. An exact pin is sometimes necessary, but it also restricts every consumer to that version.

An application deployer chooses a complete environment. A lockfile records resolved versions of direct dependencies and the dependencies they bring in. Installing from that lockfile avoids resolving version ranges afresh for each deployment. Supported platforms may still need different packages or builds.

Libraries also benefit from a lockfile for their own development and CI. That lockfile fixes the maintainers’ environment; it does not constrain consumers installing the published distribution. Consumers resolve the library’s declared requirements along with their own.

Publishing an application to a package index follows the same rule. Its repository’s lockfile does not control what an installer selects for an end user’s environment. A deployment that needs locked dependencies must explicitly install from the lockfile or bundle the chosen environment.

Choose how the application reaches users

The delivery method determines who supplies Python, installs dependencies, and applies updates:

  • A web service or pipeline runs in an environment managed by its deployer, often on a server or in a container.
  • A command-line application can be published to PyPI and installed into an environment managed by uv or pipx.
  • A desktop or command-line application can bundle Python and its dependencies with PyInstaller, giving users an executable without a separate Python installation.

How do I ship a Python application to end users? compares these delivery methods.

Last updated on