World Library  
Flag as Inappropriate
Email this Article

Pyjamas (software)


Pyjamas (software)

Original author(s) James Tauber, Google
Developer(s) Luke Leighton, Anthony C Risinger, Kees Bos
Initial release March, 2007
Stable release 0.8 / June 1, 2012 (2012-06-01)
Written in Python, JavaScript
Operating system Windows, Mac OS X, Linux
Available in Python
Type Ajax framework, Desktop and Web Widget toolkit, Compiler, Widget set
License Apache License 2.0



Pyjamas is a tool and framework for developing the client-side of Ajax-based applications in Python. The resulting applications can be run in an Internet browser or as standalone desktop application.

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. Pyjamas is a port of Google Web Toolkit[1] from Java to Python.


  • Development 1
  • Design 2
  • Components 3
  • Pyjamas Desktop 4
  • History 5
  • Forks 6
  • Fork 7
  • Fork 8
  • Alternatives 9
  • References 10
  • External links 11


Using Pyjamas, developers can write web applications in Python instead of Java. The application is compiled to JavaScript. Also included is an Ajax library and widget set[2] that provides access to the DOM model 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 GWT, "Pyjamas is not its libraries", and neither is it "yet another Ajax framework". Ajax Frameworks are strictly limited to providing pre-prepared specific functionality, written almost exclusively in tailor-made JavaScript. Both GWT and Pyjamas, 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 fait-accompli Ajax Framework, Pyjamas gives you the freedom to develop your own.


The Pyjamas compiler is written in Python, and uses the Python programming language 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 Pyjamas is for web development, so there is additional infrastructure for building web applications.

The[3] 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 model library is an additional abstraction layer,,[4] 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.


The major Pyjamas components include:

pyjs Python-to-JavaScript Compiler
Translates the Python programming language to the JavaScript programming language.
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).
Pyjamas DOM library[3]
Modules for manipulating the browser DOM.
Pyjamas Web UI module[4]
A module for creating widgets as if the web browser was a Desktop Widget Engine.
Pyjamas Desktop ports
Support for running Pyjamas apps as pure Python, under MSHTML, XULRunner or Webkit. Pyjamas Desktop is conceptually close to GWT "Hosted" mode, except that the applications can be deployed live, under Pyjamas Desktop, rather than be used exclusively as a debugging tool.

Pyjamas Desktop

The widget set library[5] that comes with Pyjamas is so similar to PyQt and PyGTK that a port of Pyjamas was made to run Pyjamas applications on the desktop, called Pyjamas-Desktop. The project uses Webkit, XULRunner or MSHTML as the underlying technology, and it is through these browser engines that Pyjamas manipulates the DOM model of the application. Pyjamas and Pyjamas Desktop allow writing cross-platform, cross-desktop, cross-browser and cross-widget applications that run on the web and on the desktop.[6][7]


Pyjamas was originally developed by James Tauber. The original code for the UI Widget Set and the DOM support libraries came from Google Web Toolkit, and was ported by James Tauber. James wrote the original pyjs compiler. Luke Leighton took over the project in 2008, and updated the UI Widget Set, improved the compiler and created the three pyjs Desktop runtimes. Bernd Dorn and his colleagues from Lovely Systems did some dramatic compiler improvements for 0.5. Kees Bos joined because he was not interested in learning JavaScript, but learn he definitely did. Kees is responsible for the majority of the vast improvements and the more esoteric Python interoperability in the compiler, such as "yield", long data type and much much more. C Anthony Risinger also joined as lead and administrator of the project.

On May 2, 2012 the leadership roles of the project came into question. This was a community driven open source project that was extensively developed by many contributors including the people mentioned above. Due to disagreements between members of the group on how to move forward with the infrastructure and direction of the software, some members decided to create their own fork of the pyjamas project. This fork was created by a team led by Anthony Risinger, one of the administrators of the project. This group included the person who owned the domain and he voluntarily decided to assign ownership of the domain to this new fork being created and hence became the new fork of the pyjamas project. Luke Leighton continued his work on his own fork through a new domain and continues to develop and maintain pyjamas on this fork.

This still left a controversy over the copying of the mailing list data from the old server to create the new mailing list of google groups. This was raised as a violation of the UK Data Protection Act by Luke Leighton. Whether this was actually a legal violation is not really clear and is open to interpretation. This was a community driven open source project. According to many in the community , both Luke and Anthony were co-administrators of the project and co-leads to it. It was being forked by a team including Anthony, one of the administrators who had privileges for the server, which Luke Leighton owned. The mailing list was part of the domain. So the ownership of the mailing list data itself isn't very clear. Though Luke claims he personally owned the mailing list and that using it to create a new mailing list for the new fork of the project constituted stealing, many in the community feel differently. Many feel that this was an open source community project and Luke Leighton was a co-lead and co-administrator. Hence the mailing list was actually a community property of the community and not the personal property of Luke. Thus, though some disagree, in the opinion of many in the community , using it to create the new google groups was legal.

Even though the ownership of the mailing list data is not entirely clear, when some members complained about being subscribed to the new google groups mailing list, immediate action was taken by the maintainers of the new fork to remove everyone from the new google groups and invited all the members to voluntarily join the new google groups. This being exactly the same approach that Luke Leighton took when he decided to move the pyjamas mailing list from google groups where it was originally created before Luke Leighton took over leadership of the project.

The current membership of the google groups owned and maintained by both forks of the original is now voluntary, created through invitation, and does not violate any privacy and data protection laws. There are no unresolved legal issues at this time nor any pending lawsuits with either forks of the pyjamas project.

Both forks are being actively developed and have formed their own community following.


There are now 2 forks of the Pyjamas Project. One maintained by the new pyjs team at .orgpyjs And another maintained by Luke Leighton at .bepyj Fork

The fork has gone through active development

  • New github based infrastructure
  • Travis-CI based continuous integration for both build, install and automated testing.
  • PIP install and VirtualEnv based development environment.
  • Separation of pyjs tools from pyjs gwt widgets. To allow other widgets sets to be developed.
  • Builtin Closure compiler integration
  • GI Introspection/WebKit-GTK based pyjs-desktop runner Fork continues to be maintained by Luke Leighton and is still active with bug fixes and new development.


Most alternatives to Pyjamas are translators rather than frameworks.

  • py2js
  • PyCow
  • Pyjaco
  • PyvaScript
  • RapydScript


  1. ^ Pyjamas project home
  2. ^ Widget Set diagram
  3. ^ a b DOM module
  4. ^ a b ui module
  5. ^ Widget set showcase
  6. ^ Pyjamas - Python Applications for Desktop and Web
  7. ^ Coding in Pyjamas: Apps for Desktop and the Web

External links

  • Pyjamas Home
  • PyXPCOMExt Hulahop Tutorial
  • Rick Hightower's IBM Developerworks Tutorial
  • Slashdot article
  • article
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.