How to package Python apps with BeeWare Briefcase

Python falls limited in a several regions. For occasion, Python is not the fastest language all over, but third-get together libraries like NumPy enable you perform all over that. Where by Python is most deficient, while, is packaging. That is, Python lacks a consistent interior mechanism for making a standalone binary from an application. Go and Rust do this. Why just cannot Python?

It typically arrives down to Python not having a lifestyle of these types of use instances right up until relatively lately in its record. And so, only relatively lately did third-get together modules begin demonstrating up that enable Python applications to be packaged as standalone binaries. PyInstaller — which I included formerly — is just one these types of app. In this short article we’ll look at an even far more exquisite and impressive utility for Python app packaging, BeeWare’s Briefcase.

[ Also on InfoWorld: Python virtualenv and venv do’s and don’ts ]

However, there are two caveats worthy of pointing out about Briefcase. Initial, Briefcase does not do cross-platform packaging you need to make on the platform you are deploying for. Next, Briefcase functions ideal with applications that make use of a GUI toolkit of some type. We’ll go into depth about these issues underneath.

What is BeeWare Briefcase?

Briefcase is portion of a typical suite of resources by BeeWare for building applications, with the diverse pieces complementing each and every other. For occasion, BeeWare’s Kivy lets you develop cross-platform GUI applications in Python that operate not only on all the major OS platforms but also on the website. But here we’ll concentration on Briefcase, which can be employed with or with no the other resources.

Briefcase offers applications for all the OSes it supports by way of a frequent structure for applications on that platform:

  • Microsoft Home windows (MSI installer)
  • macOS (.app format file)
  • Linux (AppImage)
  • iOS (Xcode job)
  • Android (Gradle job)

To deploy on iOS or Android, you will need the enhancement kits for individuals platforms.

A person matter Briefcase does not support is cross-platform deployment. For occasion, if you are a Home windows user, you just cannot make a macOS app you will need macOS to do that. Other app bundlers for Python are equally limited, so this restriction is by no signifies unique to Briefcase.

Briefcase is also not a “compiler” — it does not transform Python applications into their indigenous device-code equivalents. Your applications will not operate any quicker when deployed as Briefcase applications than they do usually.

Copyright © 2020 IDG Communications, Inc.