BRIEFCASE(1)
π NAME π
okay so bestie, gather round π«Ά β briefcase is the tool for converting Python projects into standalone native applications for distribution.
It's literally the manual page for briefcase, and yes, we're gonna read all of it. together. π
π¦ SYNOPSIS π¦
briefcase [command] [platform] [format] [options]
β¨ DESCRIPTION β¨
so like, <pink>briefcase</pink> is a tool that lets you convert a Python project into a standalone native application, ready for distribution. no cap.
It supports multiple platforms and formats, which makes it so easy to create, build, and publish applications. it's giving "your side project but make it a real app". π
πΈ USAGE πΈ
briefcase [-h] <command> [<platform>] [<format>] [...]
π ENVIRONMENT SETUP π
before you even think about touching Briefcase, you gotta prep your environment, bestie. that means two things: <cyan>Python is installed</cyan>, and you've got a <cyan>virtual environment</cyan> set up. it's a get-ready-with-me but for devs. π§
1. Install Python
Briefcase requires Python to be installed on your system. you can use the system's default Python, or manage multiple Python versions using pyenv. pick your fighter. π₯
Option 1: Use the system Python
most Linux distributions and macOS come with Python pre-installed β lucky you. to check if Python is installed, run:
python3 --version
if Python is not installed, you can install it using your system's package manager. for example:
- On Debian/Ubuntu:
sudo apt install python3 - On macOS (using Homebrew):
brew install python
Option 2: Use pyenv to manage Python versions
if you need a specific version of Python, or you're juggling multiple versions (main character energy fr fr), you can use pyenv. to install pyenv, follow the instructions at: https://github.com/pyenv/pyenv
after installing pyenv, you can install a specific Python version, for example:
pyenv install 3.9.7
and set it as the global version:
pyenv global 3.9.7
2. Create a Virtual Environment
it is recommended (read: do it) to use a virtual environment to isolate your project's dependencies. to create and activate a virtual environment, follow these steps:
- Create a virtual environment:
python3 -m venv venv
- Activate the virtual environment:
- On Linux/macOS:
source venv/bin/activate - On Windows:
venv\Scripts\activate
- On Linux/macOS:
once activated, your terminal prompt will change to indicate that the virtual environment is active. you can now install Briefcase and other dependencies within this environment. slay. β¨
π COMMANDS π
newβ create a new Briefcase project.devβ run a Briefcase project in the dev environment.convertβ set up an existing project for Briefcase.createβ create a new app for a target platform.openβ open an app in the build tool for the target platform.buildβ build an app for a target platform.updateβ update the source, dependencies, and resources for an app.runβ run an app.packageβ package an app for distribution.publishβ publish an app to a distribution channel.upgradeβ upgrade Briefcase-managed tools.
π PLATFORMS π
android, iOS, linux, macOS, web, windows
π OPTIONS π
-h,--helpβ show this help message and exit.-V,--versionβ show the program's version number and exit.
π EXAMPLES π
briefcase new
the briefcase new command requests basic information to create a new application. the following details are required:
- Formal Name: full name of the application (default:
"Hello World"). - App Name: technical name of the application, without spaces (default:
"helloworld"). - Bundle: unique app identifier. if you own a domain, enter it in reverse order (e.g.,
com.example). otherwise, use the default (com.example). - Project Name: name of the project directory (default:
"Hello World"). - Description: brief description of the application (accept the default or customize).
- Author: your name as the author of the project.
- Author's Email: your email, used for settings and publishing.
- URL: application home page (use your own domain or the default
https://example.com/helloworld). - License: choose the project license (default:
BSD). - GUI Framework: choose the GUI framework (default:
Toga, BeeWare's GUI toolkit).
and here's the lil project tree you get out of it π:
βββ venv-venv/
β βββ ...
βββ helloworld/
βββ CHANGELOG
βββ LICENSE
βββ pyproject.toml
βββ README.rst
βββ src/
β βββ helloworld/
β βββ app.py
β βββ __init__.py
β βββ __main__.py
β βββ resources/
β βββ README
βββ tests/
βββ helloworld.py
βββ __init__.py
βββ test_app.py
briefcase create
this command installs the dependencies specified in the pyproject.toml file, creating the project structure for the native operating system and configuring the necessary files for packaging and distributing the application:
(venv-venv)$ briefcase create
[helloworld] Finalizing application configuration...
Targeting ubuntu:jammy (Vendor base debian)
Determining glibc version... done
Targeting glibc 2.35
Targeting Python3.10
[helloworld] Generating application template...
Using app template: https://github.com/beeware/briefcase-linux-AppImage-template.git, branch v0.3.18
...
briefcase create android β this command configures the project structure for packaging on the Android system.
briefcase build
this command compiles and prepares a Briefcase project for distribution on the specified platform. it generates the binaries, packages and configurations required to run the application:
(venv-venv)$ briefcase build
[helloworld] Finalizing application configuration...
Targeting ubuntu:jammy (Vendor base debian)
Determining glibc version... done
Targeting glibc 2.35
Targeting Python3.10
[helloworld] Building application...
Build bootstrap binary...
make: Entering directory '/home/brutus/beeware-tutorial/helloworld/build/linux/ubuntu/jammy/bootstrap'
...
make: Leaving directory '/home/brutus/beeware-tutorial/helloworld/build/linux/ubuntu/jammy/bootstrap'
Building bootstrap binary... done
Installing license... done
Installing changelog... done
Installing man page... done
Updating file permissions... done
Stripping binary... done
briefcase run
this command executes the generated application within the environment prepared by Briefcase, ensuring that all dependencies and configurations are correctly applied:
(venv-venv)$ briefcase run
[helloworld] Finalizing application configuration...
Targeting ubuntu:jammy (Vendor base debian)
Determining glibc version... done
Targeting glibc 2.35
Targeting Python3.10
[helloworld] Starting app...
===========================================================================
Install path: /home/brutus/beeware-tutorial/helloworld/build/helloworld/linux/ubuntu/jammy/helloworld-0.0.1/usr
Pre-initializing Python runtime...
PYTHONPATH:
/usr/lib/python3.10
/usr/lib/python3.10/lib-dynload
/home/brutus/beeware-tutorial/helloworld/build/helloworld/linux/ubuntu/jammy/helloworld-0.0.1/usr/lib/helloworld/app
/home/brutus/beeware-tutorial/helloworld/build/helloworld/linux/ubuntu/jammy/helloworld-0.0.1/usr/lib/helloworld/app_packages
Configure argc/argv...
Initializing Python runtime...
Running app module: helloworld
briefcase package
this command generates the final files needed to distribute the application, such as target platform-specific installers and packages:
(venv-venv)$ briefcase packahe
[helloworld] Finalizing application configuration...
Targeting ubuntu:jammy (Vendor base debian)
Determining glibc version... done
Targeting glibc 2.35
Targeting Python3.10
[helloworld] Building .deb package...
Write Debian package control file... done
dpkg-deb: building package 'helloworld' in 'helloworld-0.0.1.deb'.
Building Debian package... done
[helloworld] Packaged dist/helloworld_0.0.1-1~ubuntu-jammy_amd64.deb
(yes, the example really does say briefcase packahe β we're preserving it exactly as written, typos are part of the historical record ππ)
π₯ SEE ALSO π₯
check the official documentation at https://briefcase.readthedocs.io/ for more details.
π AUTHOR π
Briefcase Project β https://github.com/beeware/briefcase/ or https://briefcase.readthedocs.io/en/stable/
Josenilson Ferreira da Silva <nilsonfsilva@hotmail.com> authored this manual. π«Ά
and that's the whole page, bestie! this one's BRIEFCASE 1.0.0, dated JAN 2024, and it came to you under the header/footer name BR...E(1) β anyway ily, go build something iconic πβ¨
π¦ where this page comes from
- debian trixie: python3-briefcase 0.3.22-2 Β· BSD-3-Clause
- ubuntu questing: python3-briefcase 0.3.22-2
- ubuntu resolute: python3-briefcase 0.3.25-2 Β· BSD-3-Clause
- ubuntu stonking: python3-briefcase 0.4.1-2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms