Saturday, November 7, 2009

Early release of PySiteCreator - v0.1

By Vasudev Ram

Hi readers,

I've released a tool for creating HTML pages or Web sites by writing them in Python - PySiteCreator v0.1.

Description of PySiteCreator:

PySiteCreator is a tool that allows the user to create Web (HTML) sites by writing them entirely in Python. A user creates one or more Python source files in each of which they import a PySiteCreator helper module, and then call helper functions defined in that module, in order to emit HTML elements and associated content. They can then run the PySiteCreator program to process all those Python files; processing each Python file will result in the creation of a corresponding HTML file with the desired HTML elements and content.

A useful feature of PySiteCreator is that it allows you to write almost any Python code you wish, that can fetch data from any source, for outputting to the created HTML files. The data can be fetched from text files, CSV files, DBM files, any type of file in the file system from which you can fetch data by any means, from a relational database using the Python DB API, from any source on the Internet, using sockets, XML-RPC calls, HTTP REST calls, SOAP calls, CORBA, PYRO, RPyC, or any other suitable method.

There are only a few conventions to be followed, such as importing the psc_util module in each Python file your write, and defining a top-level function in each file, that should be named create(), in order to be able to use PySiteCreator. Other than those conventions, there are no other restrictions or requirements about what kind of code you write in the Python files.

UPDATE: The PySiteCreator documentation is a bit sketchy at present (basically, a README.txt file), but I'll be improving it over the course of the next several days. Meanwhile, there are examples in the examples subdirectory of the package; viewing them will make it easy for anyone with reasonable Python skills to understand how to use PySiteCreator. The examples show a few different ways of using PySiteCreator - not just basic HTML element generation, but other things, like conditional HTML output, passing JavaScript through, linking to other pages, getting data via Mark Pilgrim's FeedParser, etc.

Requirements for PySiteCreator:

- The only software requirement for running PySiteCreator is Python
itself. PySiteCreator has been developed and tested using Python
v2.6.1. It may also work with some earlier versions of Python, particularly fairly recent ones like 2.5.x or 2.4.x.

You can get PySiteCreator from here:

http://www.dancingbison.com/PySiteCreator.zip





Vasudev Ram - Dancing Bison Enterprises

Thursday, November 5, 2009

Bison photo of the day #1

By Vasudev Ram - Dancing Bison Enterprises

This is just for fun:

I thought of putting a "Bison photo of the day" on my blog now and then.

After all, my web site is called Dancing Bison :-)

Here is the first bison photo:





I'll put other bison photos here once in a while ...

And just FYI, here is the Wikipedia entry for the Indian bison - also called gaur.



Vasudev Ram - Dancing Bison Enterprises

Wednesday, October 7, 2009

PDFXMLRPC is free for any use

By Vasudev Ram

Just realized, after my last post about PDFXMLRPC, that although I mentioned that it is released under the BSD License, I hadn't made it explicit that it is free for any use. So I'm saying it now:


PDFXMLRPC is free for any use, commercial or non-commercial.




Vasudev Ram - Dancing Bison Enterprises

PDF is green tech for your office (and home)

By Vasudev Ram

Just saw this article on Planet PDF:

PDF is green tech for your office.

It makes several good points about how PDF is green technology. Thought it only talks about the office, I'd say that statement applies to the home as well.





Vasudev Ram - Dancing Bison Enterprises

PDFXMLRPC is programmable

By Vasudev Ram

After posting the original announcement about PDFXMLRPC, I also posted details about it on the reportlab-users mailing list. A user there replied suggesting that I post the same details (which I'd posted on the mailing list), on my blog, since it described PDFXMLRPC better than my original blog post (the main difference being that I emphasized the programmability in the list post). So here it is, below:




I'm happy to announce the release of v1.0 of PDFXMLRPC, a client-server application that lets users create PDF content from text, over the Internet or their intranet, using Reportlab, xtopdf, XML-RPC and Python.

Usage example for PDFXMLRPC:

You can run the server on one computer which is connected to the Internet.

You can run the client on another computer which is connected to the Internet.

When you run the client, it sends text content to the server. The server then converts this text to PDF, and sends that PDF content back to the client over the Internet. The client then writes that PDF content to a local PDF file, which the user can then open / print / etc. (But also see the part about callability (i.e., programmability) of both the client and server below.)

The announcement of PDFXMLRPC is here on my blog:

http://jugad2.blogspot.com/2009/10/client-server-pdf-creation-with-xtopdf.html

That blog post has a link to a zip file that you can download, which contains the PDFXMLRPC package.

The zip file contains the following files:

- PDFXMLRPCServer.py - the server
- PDFXMLRPCClient.py - the client
- README.txt - documentation of the prerequisites needed (*), the URLs to get them from, the steps to install PDFXMLRPC, and steps to run the server and the client.
- License.txt - the license file (PDFXMLRPC is released under the BSD License)

(*) The prerequisites are:

- xtopdf v1.0, Reportlab v1.x and Python 2.x or higher for the server

- Python 2.x or higher for the client

(XML-RPC is required for both the client and the server, but since it is included in the standard Python library, I don't treat it as a separate prerequisite).

Although both the server and the client programs contain main() functions, and therefore both can be run as standalone programs, they are also both callable. There is one "top-level" class in each of the server and the client - PDFXMLRPCServer and PDFXMLRPCClient respectively.

The main() functions in the server and client, act as examples of how to call those classes.

Since the classes are callable, you can incorporate the functionality of the server and the client, into your own larger programs, to get the functionality of client/server PDF creation over the Net, in your own applications.

I welcome any feedback on this software. You can contact me via my contact page: http://www.dancingbison.com/contact.html .

Finally, thanks a lot to the Reportlab team and all the users who've helped improve Reportlab, for their work. And thanks a lot to the Python team and users as well.

Thanks,
Vasudev






Vasudev Ram - Dancing Bison Enterprises