jsonpickle

I have been working on an open source project, jsonpickle. The goal of the project is to be able to serialize a Python object into standard JSON notation. Python can "pickle" objects into a special binary format, but sometimes it is nice to get a human-readable format. Especially with projects like CouchDB that have use a JSON-based API. jsonpickle is on its seconds release and can now officially handle Mark Pilgrim's Universal Feed Parser. Feel free to join in by finding bugs and working on the code! It is pretty easy to use:

>>> import feedparser, jsonpickle
>>> doc = feedparser.parse("http://feedparser.org/docs/examples/atom10.xml")
>>> pickled = jsonpickle.dumps(doc)
>>> unpickled = jsonpickle.loads(pickled)
>>> doc['feed']['title'] == unpickled['feed']['title']
True

Building Python Packages from Source on Windows

I always forget how to build Python packages, such as psyco and simplejson that require C/C++ code to be compiled. The usual error I get from running "python setup.py install" is

error: Python was built with Visual Studio 2003; extensions must be
built with a compiler than can generate compatible binaries. Visual
Studio 2003 was not found on this system. If you have Cygwin
installed, you can try compiling with MingW32, by passing "-c
mingw32" to setup.py.

Now, I do not have Visual Studio 2003, but I do have mingw32. (Grab cygwin and when selecting packages, make sure than mingw-runtime and gcc are selected.) Now, back with our setup.py file, execute:

python setup.py build_ext --compiler=mingw32 install

Hopefully that should solve any issues.


CPAN on Windows

To use Perl's CPAN <http://www.cpan.org>`_on Windows with `cygwin, you need to install some additional programs in cygwin. Run cygwin's setup.exe (I like clicking the "View" button to change the listing to Full, so I get an alphabetical list of the packages). Make sure that you install the following packages:

  • perl (just in case you do not have it)
  • gzip
  • tar
  • unzip
  • make
  • lynx
  • wget
  • ncftp
  • gnupg

Open the Cygwin bash shell and enter:

perl -MCPAN -e shell

Accept the defaults, and you are good to go. Once in the CPAN shell, you can install modules with commands like:

install Date::Parse

CouchDB on Ubuntu

These results are now largely outdated by the couchdb package in the Ubuntu universe repository.

Installing CouchDB

I have eagerly been waiting to try out CouchDB. I find the concept of document storage, instead of strict relational storage, to be very interesting. Plus, Erlang seems to be gaining mindshare. I documented the process that I took to install CouchDB 0.7.2 on Ubuntu 7.10 (it is basically straight from with the CouchDB wiki, but with some small modifications to get it to work).

wget http://couchdb.googlecode.com/files/couchdb-0.7.2.tar.gz
tar -xzvf couchdb-0.7.2.tar.gz
cd couchdb-0.7.2/
sudo apt-get install automake autoconf libtool subversion-tools help2man build-essential erlang libicu36 libicu36-dev libreadline5-dev checkinstall
./configure
make
sudo checkinstall

Everything should be looking good. We need to add a user and give that user permission to some directories.

sudo adduser couchdb
sudo mkdir -p /usr/local/var/lib/couchdb
sudo chown -R couchdb /usr/local/var/lib/couchdb
sudo mkdir -p /usr/local/var/log/couchdb
sudo chown -R couchdb /usr/local/var/log/couchdb
sudo mkdir -p /usr/local/var/run
sudo chown -R couchdb /usr/local/var/run

You can run in a shell:

sudo -u couchdb couchdb

Or you can start the daemon:

sudo /usr/local/etc/init.d/couchdb start

To access to web view of the database, assuming you are running locally, go to: http://localhost:5984/_utils/index.html Stay tuned for some CouchDB programming...


Just upgraded to Gutsy Gibbon Tribe 2

After reading a post on Planet Ubuntu Users, I grew envious that I didn't have the latest and greatest of Ubuntu--so I decide to take the plunge. First I tried the sudo update-manager -c -d, which error'ed out. So I hacked away at the /usr/lib/python2.5/site-packages/UpdateManager/DistUpgradeFetcher.py file by adding import os. Everything started going fine, except my connection was crawling (almost dial-up speeds)--there was no way that I was going to wait. So I grabbed the latest ISO, picking the alternate install just to avoid the hassle of booting up into the live cd. Everything worked nicely--except I got a little worried when the install hung for ten minutes when installing Tomboy. But with a little patience, everything installed properly. I'm currently updating the system and looking into the new Dual Monitor tool. I am looking forward to exploring this new toy!