You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by "Guozhu.Wen" <gu...@gmail.com> on 2009/06/25 16:21:29 UTC

Can I get csv data format from couchDB?

The data returned from couchDB is usually a json string. Something the json
string is so big that it is time consuming for parseing this string. I use
python's simplejson module in order to convert json to dict type, but it is
many slow.

So I was wondering how can I fetch the csv data from couchDB, or is there
any efficient modules to parse the json?

Thanks in advanced!

-- 
稳
Guozhu Wen
mail: guozhuwen@gmail.com
douban: http://www.douban.com/people/wentrue/
blog: http://www.wentrue.net/blog/
twitter: https://twitter.com/wentrue

Re: Can I get csv data format from couchDB?

Posted by "Guozhu.Wen" <gu...@gmail.com>.
Thanks, that is helpful.

2009/6/25 Nathan Stott <nr...@gmail.com>

> Use show and list functions to return CSV data.
> http://wiki.apache.org/couchdb/Formatting_with_Show_and_List
>
> 2009/6/25 Guozhu.Wen <gu...@gmail.com>
>
> > The data returned from couchDB is usually a json string. Something the
> json
> > string is so big that it is time consuming for parseing this string. I
> use
> > python's simplejson module in order to convert json to dict type, but it
> is
> > many slow.
> >
> > So I was wondering how can I fetch the csv data from couchDB, or is there
> > any efficient modules to parse the json?
> >
> > Thanks in advanced!
> >
> > --
> > 稳
> > Guozhu Wen
> > mail: guozhuwen@gmail.com
> > douban: http://www.douban.com/people/wentrue/
> > blog: http://www.wentrue.net/blog/
> > twitter: https://twitter.com/wentrue
> >
>



-- 
稳
Guozhu Wen
mail: guozhuwen@gmail.com
douban: http://www.douban.com/people/wentrue/
blog: http://www.wentrue.net/blog/
twitter: https://twitter.com/wentrue

Re: Can I get csv data format from couchDB?

Posted by Zachary Zolton <za...@gmail.com>.
I've also been thinking that JSON diffs would be pretty handy for
functions for dealing with conflicts.

On Thu, Jun 25, 2009 at 11:49 AM, Noah Slater<ns...@apache.org> wrote:
> On Thu, Jun 25, 2009 at 09:11:22AM -0700, Chris Anderson wrote:
>> On Thu, Jun 25, 2009 at 8:44 AM, Noah Slater<ns...@apache.org> wrote:
>> > On Thu, Jun 25, 2009 at 09:24:31AM -0500, Nathan Stott wrote:
>> >> Use show and list functions to return CSV data.
>> >> http://wiki.apache.org/couchdb/Formatting_with_Show_and_List
>> >
>> > Sigh. This would be better done with JSON Transformations.
>>
>> Not sure what you mean. JSON Transformations is a technique that can
>> be implemented in whatever language you choose. I didn't look for a
>> JavaScript library but if there's not one, it should be easy to build.
>
> Antony Blakey and I started an effort to produce an Internet Draft that would
> standardise a syntax for JSON diffs and transformations, in a similar spirit to
> existing XML diffs and XSLT. Unfortunately, this process broke down because we
> disagreed about splitting the draft into two standards.
>
> My sigh was because this should be standardised outside of CouchDB.
>
> This is more my own failing than anything.
>
> Best,
>
> --
> Noah Slater, http://tumbolia.org/nslater
>

Re: Can I get csv data format from couchDB?

Posted by Noah Slater <ns...@apache.org>.
On Thu, Jun 25, 2009 at 09:11:22AM -0700, Chris Anderson wrote:
> On Thu, Jun 25, 2009 at 8:44 AM, Noah Slater<ns...@apache.org> wrote:
> > On Thu, Jun 25, 2009 at 09:24:31AM -0500, Nathan Stott wrote:
> >> Use show and list functions to return CSV data.
> >> http://wiki.apache.org/couchdb/Formatting_with_Show_and_List
> >
> > Sigh. This would be better done with JSON Transformations.
>
> Not sure what you mean. JSON Transformations is a technique that can
> be implemented in whatever language you choose. I didn't look for a
> JavaScript library but if there's not one, it should be easy to build.

Antony Blakey and I started an effort to produce an Internet Draft that would
standardise a syntax for JSON diffs and transformations, in a similar spirit to
existing XML diffs and XSLT. Unfortunately, this process broke down because we
disagreed about splitting the draft into two standards.

My sigh was because this should be standardised outside of CouchDB.

This is more my own failing than anything.

Best,

-- 
Noah Slater, http://tumbolia.org/nslater

Re: Can I get csv data format from couchDB?

Posted by Chris Anderson <jc...@apache.org>.
On Thu, Jun 25, 2009 at 8:44 AM, Noah Slater<ns...@apache.org> wrote:
> On Thu, Jun 25, 2009 at 09:24:31AM -0500, Nathan Stott wrote:
>> Use show and list functions to return CSV data.
>> http://wiki.apache.org/couchdb/Formatting_with_Show_and_List
>
> Sigh. This would be better done with JSON Transformations.
>

Not sure what you mean. JSON Transformations is a technique that can
be implemented in whatever language you choose. I didn't look for a
JavaScript library but if there's not one, it should be easy to build.

That said one of our students in the CouchDB training course was
outputting CSV from a list function and it turned out to be less than
10 lines of code. There are few better ways to manipulate JSON than
via JavaScript.

Chris

-- 
Chris Anderson
http://jchrisa.net
http://couch.io

Re: Can I get csv data format from couchDB?

Posted by Noah Slater <ns...@apache.org>.
On Thu, Jun 25, 2009 at 09:24:31AM -0500, Nathan Stott wrote:
> Use show and list functions to return CSV data.
> http://wiki.apache.org/couchdb/Formatting_with_Show_and_List

Sigh. This would be better done with JSON Transformations.

-- 
Noah Slater, http://tumbolia.org/nslater

Re: Can I get csv data format from couchDB?

Posted by Nathan Stott <nr...@gmail.com>.
Use show and list functions to return CSV data.
http://wiki.apache.org/couchdb/Formatting_with_Show_and_List

2009/6/25 Guozhu.Wen <gu...@gmail.com>

> The data returned from couchDB is usually a json string. Something the json
> string is so big that it is time consuming for parseing this string. I use
> python's simplejson module in order to convert json to dict type, but it is
> many slow.
>
> So I was wondering how can I fetch the csv data from couchDB, or is there
> any efficient modules to parse the json?
>
> Thanks in advanced!
>
> --
> 稳
> Guozhu Wen
> mail: guozhuwen@gmail.com
> douban: http://www.douban.com/people/wentrue/
> blog: http://www.wentrue.net/blog/
> twitter: https://twitter.com/wentrue
>

Re: Can I get csv data format from couchDB?

Posted by Sergey Shepelev <te...@gmail.com>.
I second cjson option.

We're using cjson in production for like half year, passing around big
objects and lists, it works fine and fast.

2009/6/25 Kevin Ferguson <ke...@meebo-inc.com>:
> python-cjson is many times faster than simplejson-- maybe 8x faster or so.
>
> http://www.vazor.com/cjson.html
>
> Kevin
> ________________________________________
> From: Guozhu.Wen [guozhuwen@gmail.com]
> Sent: Thursday, June 25, 2009 7:21 AM
> To: user@couchdb.apache.org
> Subject: Can I get csv data format from couchDB?
>
> The data returned from couchDB is usually a json string. Something the json
> string is so big that it is time consuming for parseing this string. I use
> python's simplejson module in order to convert json to dict type, but it is
> many slow.
>
> So I was wondering how can I fetch the csv data from couchDB, or is there
> any efficient modules to parse the json?
>
> Thanks in advanced!
>
> --
> 稳
> Guozhu Wen
> mail: guozhuwen@gmail.com
> douban: http://www.douban.com/people/wentrue/
> blog: http://www.wentrue.net/blog/
> twitter: https://twitter.com/wentrue
>

Re: Can I get csv data format from couchDB?

Posted by Benoit Chesneau <bc...@gmail.com>.
2009/6/25 Kevin Ferguson <ke...@meebo-inc.com>:
> python-cjson is many times faster than simplejson-- maybe 8x faster or so.
>
> http://www.vazor.com/cjson.html
>
> Kevin

Even when using C extension of simplejson ?

RE: Can I get csv data format from couchDB?

Posted by Kevin Ferguson <ke...@meebo-inc.com>.
python-cjson is many times faster than simplejson-- maybe 8x faster or so.

http://www.vazor.com/cjson.html

Kevin
________________________________________
From: Guozhu.Wen [guozhuwen@gmail.com]
Sent: Thursday, June 25, 2009 7:21 AM
To: user@couchdb.apache.org
Subject: Can I get csv data format from couchDB?

The data returned from couchDB is usually a json string. Something the json
string is so big that it is time consuming for parseing this string. I use
python's simplejson module in order to convert json to dict type, but it is
many slow.

So I was wondering how can I fetch the csv data from couchDB, or is there
any efficient modules to parse the json?

Thanks in advanced!

--
稳
Guozhu Wen
mail: guozhuwen@gmail.com
douban: http://www.douban.com/people/wentrue/
blog: http://www.wentrue.net/blog/
twitter: https://twitter.com/wentrue