Pyjs

Last updated
Pyjs
Original author(s) James Tauber, Google
Developer(s) Luke Leighton, Anthony C Risinger, Kees Bos
Initial releaseMarch 2007;17 years ago (2007-03)
Stable release
0.8.1a [1]   OOjs UI icon edit-ltr-progressive.svg / 9 May 2012;11 years ago (9 May 2012)
Repository
Written in Python, JavaScript
Operating system Windows, OS X, Linux
Available in Python
Type Ajax framework, Desktop and Web Widget toolkit, Compiler, Widget set
License Apache License 2.0
Website pyjs.org

Pyjs (formerly Pyjamas before May 2012 [2] ), is a rich web application framework for developing client-side web and desktop applications in Python. The resulting applications can be run in a web browser or as standalone desktop applications.

Contents

It contains a stand-alone Python-to-JavaScript compiler, an Ajax framework and widget toolkit, and through use of these components, developers can write comprehensive applications, to run in all major web browsers, without writing any JavaScript. Pyjs is a port of Google Web Toolkit (GWT) from Java to Python. [3]

Development

Using pyjs, developers can write web applications in Python instead of JavaScript. The application is compiled to JavaScript. Also included is an Ajax library and widget set [4] that provides access to the Document Object Model (DOM) of modern JavaScript-capable web browsers. The Ajax library and the widget set library are a hybrid mix of Python and JavaScript. Just as with Google Web Toolkit, pyjs is not its libraries, and neither is it just another Ajax framework. Ajax frameworks are strictly limited to providing pre-prepared specific functionality, written almost exclusively in tailor-made JavaScript. Both GWT and pyjs, being JavaScript compilers, allow the developer to work in the language with which they are familiar (Java or Python, respectively), to write their own custom widgets, either entirely from scratch or based on the existing available widgets, yet still target the full range of modern browsers. So, far from presenting web developers with a ready-made Ajax framework, pyjs gives you the freedom to create your own.

Design

The pyjs compiler is written in the programming language Python, and uses it to compile its input into JavaScript, walking the abstract syntax tree of the program being compiled. Although the compiler is stand-alone, the primary use of pyjs is for web development, so there is additional infrastructure for building web applications.

The DOM.py [5] model library is an abstraction layer — a thin layer of Python on top of JavaScript code snippets — use of which provides access to the full Document Object Model of the target browser platform. As with any compiler, the JavaScript snippets are treated as inline assembler.

Furthermore, on top of the DOM.py model library is an additional abstraction layer, ui.py, [6] which provides the most useful layer to web developers: a full suite of widgets with which desktop application developers will be familiar. At present, the list of available widgets is a mixture of the complete set of widgets that were available in Google Web Toolkit 1.2, along with a few more that have been forward-ported from GWT 1.5.

Components

The major Pyjs components include:

pyjs Python-to-JavaScript Compiler
Translates the programming language Python into JavaScript.
Python builtin and standard emulation library
JavaScript implementations of the commonly used modules, builtins and classes in the Python standard runtime library (such as strings, lists, dictionaries, tuples, sets, getattr, map, filter, range, etc.; basic exception handling, a basic datetime and a basic math module).
pyjs DOM library [5]
Modules for manipulating the browser DOM.
pyjs Web UI module [6]
A module for creating widgets as if the web browser was a desktop widget engine.
pyjs Desktop ports
Support for running pyjs apps as pure Python, under MSHTML (Trident), Gecko (XULRunner) or WebKit. Pyjs Desktop is conceptually close to GWT "Hosted" mode, except that the applications can be deployed live, under pyjs Desktop, rather than be used exclusively as a debugging tool.

pyjs Desktop

The widget set library [4] that comes with pyjs is so similar to PyQt and PyGTK that a port of pyjs was made to run pyjs applications on the desktop, called pyjs Desktop (formerly PyjamasDesktop [7] before May 2012 and originally hosted separately prior to version 0.6 [8] ). The project uses Webkit, XULRunner or MSHTML as the underlying technology, and it is through these browser engines that pyjs manipulates the DOM model of the application. Together pyjs and pyjs Desktop allow writing cross-platform, cross-desktop, cross-browser and cross-widget applications that run on the web and on the desktop. [9] [10]

Related Research Articles

In computing, cross-platform software is computer software that is designed to work in several computing platforms. Some cross-platform software requires a separate build for each platform, but some can be directly run on any platform without special preparation, being written in an interpreted language or compiled to portable bytecode for which the interpreters or run-time packages are common or standard components of all supported platforms.

<span class="mw-page-title-main">PyQt</span> Python GUI library

PyQt is a Python binding of the cross-platform GUI toolkit Qt, implemented as a Python plug-in. PyQt is free software developed by the British firm Riverbank Computing. It is available under similar terms to Qt versions older than 4.5; this means a variety of licenses including GNU General Public License (GPL) and commercial license, but not the GNU Lesser General Public License (LGPL). PyQt supports Microsoft Windows as well as various kinds of UNIX, including Linux and MacOS.

A user interface markup language is a markup language that renders and describes graphical user interfaces and controls. Many of these markup languages are dialects of XML and are dependent upon a pre-existing scripting language engine, usually a JavaScript engine, for rendering of controls and extra scriptability.

A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. Web frameworks provide a standard way to build and deploy web applications on the World Wide Web. Web frameworks aim to automate the overhead associated with common activities performed in web development. For example, many web frameworks provide libraries for database access, templating frameworks, and session management, and they often promote code reuse. Although they often target development of dynamic web sites, they are also applicable to static websites.

Echo is a web application framework created by the company NextApp. The latest iteration, Echo3, allows writing applications in either server-side Java or client-side JavaScript. Server-side applications do not require developer knowledge of HTML, HTTP, or JavaScript. Client-side JavaScript-based applications do not require a server, but can communicate with one via AJAX.

<span class="mw-page-title-main">Google Web Toolkit</span> Free Java library

Google Web Toolkit, or GWT Web Toolkit, is an open-source set of tools that allows web developers to create and maintain JavaScript front-end applications in Java. It is licensed under Apache License 2.0.

<span class="mw-page-title-main">Aptana</span> Text editor

Aptana, Inc. is a company that makes web application development tools for use with a variety of programming languages. Aptana's main products include Aptana Studio, Aptana Cloud and Aptana Jaxer.

qooxdoo Open-source Ajax web application framework

qooxdoo is an open-source Ajax web application framework. It is an LGPL- and/or EPL-licensed client-side and server-agnostic solution, and includes support for professional JavaScript development, a graphical user interface (GUI) toolkit and high-level client-server communication.

QF-Test from Quality First Software is a cross-platform software tool for automated testing of programs via the graphical user interface. The program is specialized on cross-browser test automation of static and dynamic web-based applications. Version 4.1 added support for MacOS and the Apple Safari and Microsoft Edge browsers via the Selenium WebDriver. RESTful web service testing. From version 5.0, Windows applications can also be tested and modern C++ applications. Version 5.3 added support for the Chrome DevTools protocol, which allows browsers to be controlled using CDP drivers.

Morfik Technology Pty Ltd. is an Australian software company that was acquired by Altium in 2010.

This is a comparison of web frameworks for front-end web development that are heavily reliant on JavaScript code for their behavior.

A single-page application (SPA) is a web application or website that interacts with the user by dynamically rewriting the current web page with new data from the web server, instead of the default method of a web browser loading entire new pages. The goal is faster transitions that make the website feel more like a native app.

ZK is an open-source Ajax Web application framework, written in Java, that enables creation of graphical user interfaces for Web applications with little required programming knowledge.

<span class="mw-page-title-main">Vaadin</span>

Vaadin is an open-source web application development platform for Java. Vaadin includes a set of Web Components, a Java web framework, and a set of tools that enable developers to implement modern web graphical user interfaces (GUI) using the Java programming language only, TypeScript only, or a combination of both.

Wt is an open-source widget-centric web framework for the C++ programming language. It has an API resembling that of Qt framework, also using a widget-tree and an event-driven signal/slot system.

<span class="mw-page-title-main">Google Plugin for Eclipse</span> Set of Java development tools

Google Plugin for Eclipse (GPE) was a set of development tools that enabled Java developers to design, build, optimize, and deploy cloud computing applications. developers in creating complex user interfaces, generating Ajax code using the GWT Web Toolkit, and deploying applications to Google App Engine. GPE installed into the Eclipse integrated development environment (IDE) using the extensible plugin system. GPE was available under the Eclipse Public License 1.0.

JWt is an open-source widget-centric web application framework for the Java programming language developed by Emweb. It has an API that uses established GUI application development patterns. The programming model is component-based and event-driven, similar to Swing.

References

  1. "Release 0.8.1a". 9 May 2012. Retrieved 22 July 2018.
  2. Infrastructure, endpoint, process changes, clarification by Lex on pyjamas-dev mailing list (May 03, 2012)
  3. pyjs README
  4. 1 2 The ui Module Class Hierarchy
  5. 1 2 DOM module
  6. 1 2 ui module
  7. PyjamasDesktop history, Python Wiki
  8. "Pyjamas Desktop".
  9. Pyjamas - Python Applications for Desktop and Web, Luke Kenneth Casson Leighton (August 30, 2008)
  10. Coding in Pyjamas: Apps for Desktop and the Web Luke Kenneth Casson Leighton (November 7, 2008)