Skip to content

PythonJS/webalchemy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

##Webalchemy Modern web development with Python, powered by Pythonium and Tornado (and in the future AsyncIO, AutobahnPython, PyZMQ). it's MIT licensed

##Getting Started

###Installation

  • Use Python3
  • Copy the webalchemy directory to your project root directory (yeah, poorman's install, never fails!)

###Tutorial and Documentation

There is not much yet except a few examples. See below how to run them:

class HellowWorldApp:
    def initialize(self, **kwargs):
        kwargs['remote_document'].body.element(h1='Hello World!!!')

to run just do:

from webalchemy import server
server.run(HellowWorldApp)

set your browser to http://127.0.0.1:8080

####Example 1: Realtime Meteor Colors:

We "translated" Meteor colors app to webalchemy. The app can be seen in action here and the Meteor original here. The source is in the examples directory, it can be executed like this:

from webalchemy import server
from webalchemy.examples.colors_meteor_example import ColorsMeteorApp
server.run(ColorsMeteorApp)

####Example 2: "Static" TodoMVC:

from webalchemy import server
from webalchemy.examples.todomvc.todomvc import AppTodoMvc as app
server.run(app, main_html_file_path='static/template/index.html')

####Example 3: WebGL Earth:

from webalchemy import server
from webalchemy.examples.three_d_earth.three_d_earth import ThreeDEarth
server.run(ThreeDEarth)

there is a file in the same directory that serves to freeze the app into a single html file

##Philosophy

The main idea is to write all server-side code and automate the client using proxy objects. This works well for all kinds of apps. For e.g. if you want 100% client side, just tell the server to generate or serve the client code. If you want 99% server then don't use any client code except for passing events to the server, which will decide what to do. This is like the opposite of what Meteor does, but seems to have several advantages. The best advantage is that you get to enjoy all the Python ecosystem on the server. Want to do some number crunching, machine learning, natural language analysis, or cartography? No problem! Other advantages are server-side code and HTML generation, Python on client side, scaling with ZMQ, etc.

##What to expect:

  • Documentation :)
  • Major cleanup
  • asyncio to replace Tornado in Python3.4
  • ZMQ (for some real scalability, like with IPython)
  • Data binding for general usage, not just the DOM. Use it with pixi.js sprites, use it to bind server-side model with client side model, etc.