Return-Path: Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: (qmail 40957 invoked from network); 6 Nov 2009 15:22:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 Nov 2009 15:22:48 -0000 Received: (qmail 37838 invoked by uid 500); 6 Nov 2009 15:22:48 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 37785 invoked by uid 500); 6 Nov 2009 15:22:47 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 37776 invoked by uid 500); 6 Nov 2009 15:22:47 -0000 Delivered-To: apmail-incubator-couchdb-commits@incubator.apache.org Received: (qmail 37773 invoked by uid 99); 6 Nov 2009 15:22:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Nov 2009 15:22:47 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Nov 2009 15:22:36 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 941A116E0A; Fri, 6 Nov 2009 15:22:15 +0000 (GMT) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Fri, 06 Nov 2009 15:22:15 -0000 Message-ID: <20091106152215.970.71154@eos.apache.org> Subject: =?utf-8?q?=5BCouchdb_Wiki=5D_Update_of_=22Getting=5Fstarted=5Fwith=5FPyth?= =?utf-8?q?on=22_by_DougShawhan?= X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for c= hange notification. The "Getting_started_with_Python" page has been changed by DougShawhan. http://wiki.apache.org/couchdb/Getting_started_with_Python?action=3Ddiff&re= v1=3D12&rev2=3D13 -------------------------------------------------- Getting started with Python and the CouchDB API. = =3D=3D Library =3D=3D - = =3D=3D=3D couchdbkit =3D=3D=3D - = - http://couchdbkit.org/ + . http://couchdbkit.org/ = Start using Couchdbkit by reading the [[http://couchdbkit.org/docs/gettin= gstarted.html|Getting Started tutorial]]. = @@ -15, +13 @@ =3D=3D=3D couchdb-python =3D=3D=3D The code for the Python library can be obtained from: = - http://code.google.com/p/couchdb-python + . http://code.google.com/p/couchdb-python = From a terminal window: = @@ -25, +23 @@ $ wget http://pypi.python.org/packages/2.5/C/CouchDB/CouchDB-0.6-py2.5.egg $ sudo easy_install CouchDB-0.6-py2.5.egg }}} - = This first downloads and installs the ''ez_setup.py'' script which runs p= ython ''.egg'' files. The second part downloads the ''.egg'' file for Couch= DB and installs it along with its dependencies. = =3D=3D=3D couchquery =3D=3D=3D - = - http://mikeal.github.com/couchquery/ + . http://mikeal.github.com/couchquery/ - = = =3D=3D Tutorial on using couchdb-python with Django =3D=3D - = A tutorial on using Django (a Python framework) with CouchDb can be found= at = + . http://lethain.com/entry/2008/aug/18/an-introduction-to-using-couchdb-= with-django/ http://www.eflorenzano.com/blog/post/using-couchdb-django/ - http://lethain.com/entry/2008/aug/18/an-introduction-to-using-couchdb-w= ith-django/ - = - http://www.eflorenzano.com/blog/post/using-couchdb-django/ = Alternatively you can view just the source for that example at = - http://github.com/lethain/comfy-django-example/tree/master + . http://github.com/lethain/comfy-django-example/tree/master = =3D=3D Example Wrapper Class =3D=3D + Demonstration of basic API-interaction using Python. (note: as of python = 2.6, one can use "import json" for the same functionality in this script.) - = - Demonstration of basic API-interaction using Python. = {{{#!python #! /usr/bin/python2.4 @@ -116, +107 @@ r =3D self.post(''.join(['/', dbName, '/']), body) prettyPrint(r) = - def deleteDoc(self, dbName, docId): = + def deleteDoc(self, dbName, docId): # XXX Crashed if resource is non-existent; not so for DELETE on d= b. Bug? - # XXX Does not work any more, on has to specify an revid = + # XXX Does not work any more, on has to specify an revid # Either do html head to get the recten revid or provide it a= s parameter r =3D self.delete(''.join(['/', dbName, '/', docId])) prettyPrint(r) @@ -151, +142 @@ c.request("DELETE", uri) return c.getresponse() }}} - = =3D=3D Usage Example =3D=3D - = {{{#!python def test(): foo =3D Couch('localhost', '5984') @@ -206, +195 @@ if __name__ =3D=3D "__main__": test() }}} - = =3D=3D Sample Output =3D=3D - = {{{#!java Create database 'mydb': {