1) Summary

APyaX (Asynchronous Python and XHTML) aims to provide a lightweight, easy to use framework for building AJAX-based web applications leveraging Python scripts running on the server and JavaScript running in the client web browser.

APyaX consists of a generator and a dispatcher. The APyaX generator can pre-process (X)HTML files to convert embedded or referenced Python scripts into JavaScript stubs which can execute in the Client web-browser. The APyaX dispatcher runs within the web server, providing a service which executes Python scripts in response to AJAX invocations made from the JavaScript stubs. Calls between the client JavaScript and server Python are typically made using XMLHttpRequest. The APyaX dispatcher also exposes to those python scripts a simple and portable API for managing sessions and database connections.

The APyaX dispatcher is designed to run on top of any server that implements the Python Web Services Gateway Interface (WSGI).

APyaX is a component of VelociKit, a lightweight system to enable the building small and meduim web-based applications.

See also the following documents (included in the APyaX package):


Lists open source packages distributed with APyaX


Brief HOWTO on installing and running APyaX demos

1.1) Motivation

APyaX aims to provide a very simple and easy to use framework for building AJAX style web applications, using Python.

1.2) Goals

1.3) Overview

APyaX provides a lightweight mechanism for integrating JavaScript running in a client browser with python running on a web server to enable the rapid development of AJAX-style applications. APyaX allows an application developer to link Python scripts into an XHTML web page and easily call Python functions within those scripts from JavaScript.

The APyaX generator is provided to pre-process the XHTML, replacing each Python function in referenced with JavaScript stubs. When the JavaScript stub is invoked in the web page, a remote procedure call (RPC) is made to the APyaX runtime web service. The RPC is implemented via an XMLHttpRequest message using JSON-RPC to encode the arguments and return value. The generator also generates stubs for form/file upload (using POST) and dynamic file download (using GET).

A portable, minimal runtime environment called the APyaX dispatcher is provided for running APyaX python scripts in a web server that supports the python Web Service Gateway Interface (WSGI). APyaX release 1.0 will provide the APYaX dispatcher:

The APyaX dispatcher also provides a simple API to expose:

Database adapters for other open source databases will be added in future. APyaX can be easily extended to provide database connectivity via new database adapter classes for any database driver conforming to the Python DBAPI 2.0 standard.

The following architecture diagram depicts how APyaX applications might typically be deployed:

1.4) What APyaX is not

It is worth noting that APyaX does not aim to provide ANY of the following: