What’s the buzz: Python gorges on tools and libraries

08.06.2016
The BeeWare project is increasing options for the Python language by offering a collection of tools and libraries for mobile and web development.

Billed as "BeeWare, the IDEs of Python," the collection follows the "Unix philosophy" of each doing one thing well. Libraries provide functionality ranging from iOS and Android application development to CSS support, while tools cover activities ranging from browser support to conversion of Python code to Java and debugging.

"The BeeWare project is a collection of tools and libraries to get native user interfaces out to people using Python as a deployment language," said project founder Russell Keith-Magee. Desktop, mobile, and even tvOS development is enabled, as is building single-page Web applications.

But the project still is in its early stages. "The low-level tool chain -- the pieces that let Python run on mobile devices and give access to the native system libraries -- is the more mature part of the project; probably somewhere around late-alpha/early-beta phase," Keith-Magee said. "The user-facing APIs like Toga are at proof-of-concept stage, and still in rapid development."

Featured as a library, Toga is a native, cross-platform widget toolkit for building GUIs for iOS and Android. It uses native buttons for iOS, while for Android development, Toga uses BeeWare's Voc transpiler to convert Python bytecode directly to Java bytecode.

Another library, iOS Template, provides a cookie-cutter template for deploying Python code on iOS. The Python Android Template library, meanwhile, does the same for Android.

The included Batavia tool runs Python bytecode in the browser by implements a Python 3.4 bytecode machine to handle function calls and basic class definitions. "I think it's probably optimistic to think [Batavia] it will ever completely replace JavaScript -- but I believe it has the potential to demonstrate that being able to support multiple languages in the browser would be of benefit to the entire Web ecosystem," said Keth-Magee. Batavia does not, however, support all of Python's built-in functions or the full standard library, it lacks support for full class inheritance, and it doesn't make a good distinction between integer and floating-point math.

Also in the BeeWare suite, the Rubicon library features a collection of tools bridging Python to other environments, including Objective-C and Java. "It allows you to instantiate, manipulate and extend all the native iOS libraries as if they were native Python libraries," said Keith-Magee.

The Cricket graphical tool runs Python test suites, supporting pre-Django 1.6 project test suites, Django 1.6-plus suites using unittest2-style discovery, and unittest test suites. Bugjar serves as a graphical interactive debugger for Python code, while Duvet is a GUI tool for visualizing code coverage results visualized by the Coverage.py tool.

BeeWare's Briefcase tool serves as a distutils extension to help package Python projects as standalone applications. The Colosseum library provides a partial implementation of the CSS box and flexbox.layout algorithm, while the Cassowary library is an implementation of the Cassowary constraint-solving algorithm. "At this point, the importance [of the Cassowary tool] is historical," Keith-Magee said. "The first iteration of the Toga widget toolkit used the Cassowary algorithm for widget layout. Cassowary is the underlying algorithm behind the constraint-based layout that iOS uses natively as of iOS 6."

(www.infoworld.com)

Paul Krill