I just discovered impure.com and was very impressed by what can be achieved in terms of visualizing data using their workspace. Although the platform is free to use, but not open source yet. This causes a few problems because the API section works with .com sites for eg. for ebay, so I cannot visualize ebay listings for regional sites such as ebay.in because the link to ebay.com is hardcoded.
I searched around, but didn't find other projects that offer a similar way to work with site APIs and other data sources with the kind of user interface and detail that impure.com does in a realtime way within a browser window.
This brings me to the questions:
What technologies would be involved in creating a similar kind of project
What are the open source tools that can help develop a fullscreen UI to render the workspace. Are there any alternatives to flash for this, and how do they compare
The goal would be to use standard python data structures, python scripts to do some processing on these data structures, scripts to gather data from csv, json and API sources such as google yahoo, wikipedia and flickr, and scripts to render graphs, tag clouds, network visualizations etc. Then bring them all together into a visual interface that supports drag drop and simple type checking
How would the python backend integrate with the UI
sorry for the rambling question, but i wanted to present as much detail as possible. I'd like to do this for the fun of it
So, restating, Impure is like OpenDX but running in a browser and you are interested in suggestions for an architecture to build your own web version of it?
I suggest using Cappuccino as your front end Web GUI. This is a toolkit for building RIAs in the browser that are completely based on HTML and Javascript (no Flash). It is modeled after Apple's Cocoa so you can build some very sophisticated apps with it.
On the web server side, I would use the Python bindings to OpenDX to build a JSON API that is exposed to the web browser. Note, this Python module uses DXLink, which appears to be mainly a batch/command interface to OpenDX - you might still need to do some work to get visualizations out of it and back to the web browser. But, it's all open source so it should be feasible. Here's a discussion where others are attempting the same thing.
I don't know for sure that OpenDX supports pulling data via web service calls but you could certainly handle that on the Python side and feed it into OpenDX.
Note, I don't mention a Python web framework because, since your app will be mostly a JSON API almost any of them would work just as well. I suggest the thinnest and simplest one that appeals to you.
Related
Im starting a new project for personal porpuse!
Im working personally in finance, I decided to create personal chart viewing software to suit my needs. I thought I'd create a good part of the backend in Python as it is a language I know quite well. Use Javascript for the graphic side, and use a webview in a windows form to make everything available as if it were software.
As for the graphics I thought of using: Lightweight Library for JS, I find that today it is the most avant-garde library compared to the classic plotly, matplotlib.
Use pywebview as a bridge between Python and JS and to redirect everything in a windows form.
However I find it a bit difficult to use this library (pywebview), there is a poor documentation around and not very clear to me (my level of JS is really basic). However, I believe it is one of the most convenient solutions.
I would have thought of using pyscript, but it still seems early to use this library in production.
Questions:
Do you think such a job is feasible?
Do you know other libraries/better solutions to do such jobs?
What kind of approach would you use if you were to do such work?
What I am trying to achieve is to write most of the functions in python and use only JS to make calls through buttons or to get data from various inputs.
Wandering around the web I found a work already partially created by this guy (if you are reading, Thanks Filipe you have been very helpful! here you can see his project hosted on Github) but unfortunately it is difficult for me to get my hands on a code not produced by me.
Question: is it possible to recreate such functionality with python? http://itools.subhashbose.com/grapher/index.php
Backstory: We want to create a hybrid online teaching/computational resource for undergraduate students of our institute, running on a local server. I have worked only in matlab, and have fair bit experience in c++. so wanted to choose appropriate language (preferably open source, but not strictly) which can facilitate above functionality with mathematica cdf like properties. I wanted to learn python form long time so wanted to know if it can do the job. Dont want to use javascript (which i suppose is used in this page).
For fetching data from html have a look at this site: http://docs.python.org/2/howto/urllib2.html.
If you want to built your own site, there are small web frameworks like flask and bottle. If you are interested in a more comprehensive web framework, check out Django: http://www.djangoproject.com/.
Matplotlib could be used to generate the plot e.g. in jpg or svg. The latter might give you the option to have the image respond to e.g. hovering over specific parts of the plot like in your example page.
Maybe also have a look at https://pypi.python.org/pypi/django-chart-tools. From their webpage:
django-chart-tools is a simple app for creating charts in django templates using Google Chart API.
I hope I'm asking on the right StackExchange site.
I've written a console program in Python onto which I'd like to put a web interface, but I'm having a hard time deciding what web framework to choose. I don't need much, but I'd like to avoid unnecessary work in trying to use it. I don't have a need for a database (for now), so that's not important to me at all.
I've looked at Django, Web2py, bottle.py, and web.py.
Django and Web2py seem to be great if I were starting out from scratch, but I'm not, and seems a little difficult to integrate into existing code.
bottle.py and web.py almost seem like they could work out, but they're so basic, I'm hoping there's something else out there that wouldn't require so much in the way of templating as these seem to do.
I don't simply want to make a carbon copy of the console interface put into a browser, but rather customize it for a web interface, so I'm not necessarily looking for anything that would simply wrap a console application into a web interface (although that would be interesting too.)
That's a sort of hard problem... Personally I don't see web.py as all that 'basic' as you put it. It should be really easy to wrap your code in some classes with GET and POST functions and be done.
Also, Django can be 'minified' as it were: How do I write a single-file Django application? is a whole conversation about this.
I would say, what is too 'basic' for you? You mentioned 'templating', but how would something magically template for you? There are open source templates for web apps, things like twitter bootstrap come to mind, that kind of give you a ready-made template for your next web app. Also YUI, and dojo do similar sorts of things (tho have a much different focus, since they are full blown JS frameworks).
That said, there is a brand new project called 'shovel' (here): https://github.com/seomoz/shovel
I haven't used it yet, but it seems to do the wrapping of commands into a web interface for you. which you said would be 'interesting'.
Personally I use web.py for all my web stuff.
I suggest Django. I've used Django both for simple mostly static sites and for sites with a lot of forms and I can't say Django imposes any restrictions or forces you to write hundreds LoC even for simple things. Instead you get nice auto generated administrative interface, built-in ORM, internationalization tools and many other things. Thereby, you have great opportunities to grow functionality of your app. In addition it has such vital thing as up-to-date documentation for every module.
Tutorial takes few hours and gives enough information to start developing full-blown sites.
Thanks the continuation which is implemented in the Nagare framework, you can develop a Web application like a console or desktop UI application: put the console code in a component.Task, then create some components for each interaction, i.e. some views that show the data that you print in your console application and receive some user input back. Then, the Nagare framework takes care of the rest: no need to declare URLS, to pass the context from a page to next...
PyQT can be handy if you are looking to implement it, to quote from the RiverBank PyQT website listed below:
"The QtWebKit module implements a web browser engine based on the WebKit open source browser engine used by Apple's Safari. It allows the methods and properties of Python objects to be published and appear as JavaScript objects to scripts embedded in HTML pages."
Source: http://www.riverbankcomputing.co.uk/software/pyqt/intro
Also, do not give up hope if that does not do the trick, as there is also "Pyjamas" which is very handy! Here is a brief description of it:
"Pyjamas is a Rich Internet Application (RIA) Development Platform for both Web and Desktop.
It contains a Python-to-Javascript compiler, an AJAX framework and a Widget Set API. Pyjamas started life as a Python port of Google Web Toolkit, the Java-to-Javascript compiler. Read the FAQ and the list of features."
source: http://pyjs.org
found via: google.com
I would say that when you are always looking to see what the best to use is, ask your question in google, and look on multiple sites and compare the top results of multiple sites to your question, also, it really depends on what you need and what your strong hand plays better in.
I was wondering if it is possible to implement a web based game in python. I have searched the internet and cannot seem to find any tutorial or document pointing to this. Any advice will be appreciated..
Your question is a bit vague but from what I understand you are trying to create a web based game with Python.
As python is a serverside language you could implement the website/server with it but for the client and the game itself you will need a browser based client-side technology. Like Flash, Silverlight, WEBGL or Even Javascript and HTML5. But this will all depend on how you would like to structure your game.
You could create a Server that pushes information to the clients with a library with say Twisted. The other option you could choose is to create a website that the clients will poll for information or use Comet for Push.
These are the only ways I know to "directly" code in python for the web :
Pyjamas which is a python to pyjamas compiler. See this asteroid example (buggy on Chrome). I made one myself and simple stuffs are working well but you can't display text on the canvas at the moment. And i guess It would be much slower than pure javascript.
IronPython with Silverlight and here a tutorial.
Panda3D and its plugin, so you'll have to ask the players to download that plugin.
Of course it is. But without more information on what type of game it is impossible to provide further guidance.
Python is a serverside language. For the "web" in web-based you still need HTML und JS (or Flash). Using Python for the serverside is possible. Here is a list of Python web frameworks (my personal favorite is Django).
Python can be used in a variety of ways for developing web games. In particular, it can be very useful for doing the back-end of a multiplayer game. For the front-end you will probably need to use a client-side technology like Flash, but there have been turn-based games that simply use static HTML as the front-end (for example, Urban Dead) and that could be implemented in Python alone without a separate client-side technology.
I'm trying to develop an application that would be perfect for GWT, however I am using this app as a learning example for Django. Is there some precedence for this type of application in Django?
Pyjamas is sort of like GWT which is written with Python. From there you can make it work with your django code.
Lots of people have done this by writing their UI in GWT and having it issue ajax calls back to their python backend. There are basically two ways to go about it. First, you can simply use JSON to communicate between the frontend and the backend. That's the approach you will find here (http://palantar.blogspot.com/2006/06/agad-tutorial-ish-sort-of-post.html). Second, some people want to use GWT's RPC system to talk to python backends. This is a little more involved, but some people have created tools (for example, http://code.google.com/p/python-gwt-rpc/).
To be honest, most successful projects just use JSON to communicate between GWT and the python server. GWT's RPC is pretty advanced in that it is able to serialize arbitrary java object graphs to and from the client. It's a tricky problem to get right and I'm pretty doubtful that any of the python tools have it right.