Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #95502

Re: JSON Object to CSV file

Newsgroups comp.lang.python
Date 2015-08-19 18:54 -0700
References <dd791644-35b4-4400-a683-d409808c0c5b@googlegroups.com>
Message-ID <45204962-beac-401e-b529-b28720df0fcd@googlegroups.com> (permalink)
Subject Re: JSON Object to CSV file
From ryguy7272 <ryanshuell@gmail.com>

Show all headers | View raw


On Wednesday, June 17, 2015 at 11:00:24 AM UTC-4, kbtyo wrote:
> I would like to have this JSON object written out to a CSV file so that the keys are header fields (for each of the columns) and the values are values that are associated with each header field. Is there a best practice for working with this? Ideally I would like to recursively iterate through the key value pairs. Thank you in advance. I am using Python 3.4 on Windows. My editor is Sublime 2. 
> 
> {
> "CF": {
> "A": "5",
> "FEC": "1/1/0001 12:00:00 AM",
> "TE": null,
> "Locator": null,
> "Message": "Transfer Fee",
> "AT": null,
> "FT": null,
> "FR": "True",
> "FY": null,
> "FR": null,
> "FG": "0",
> "Comment": null,
> "FUD": null,
> "cID": null,
> "GEO": null,
> "ISO": null,
> "TRID": null,
> "XTY": "931083",
> "ANM": null,
> "NM": null
> },
> "CF": "Fee",
> "ID": "2"
> }



Please see this link.
https://pypi.python.org/pypi/xmlutils

I'm not sure if that will help you.  I just found it toady.  Also, I'm pretty new to Python.  Anyway, hopefully, it gets you going in the right direction...

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

JSON Object to CSV file Saran A <ahlusar.ahluwalia@gmail.com> - 2015-06-17 08:00 -0700
  Re: JSON Object to CSV file Sahlusar <ahlusar.ahluwalia@gmail.com> - 2015-06-17 08:45 -0700
    Re: JSON Object to CSV file Peter Otten <__peter__@web.de> - 2015-06-17 20:19 +0200
      Re: JSON Object to CSV file Sahlusar <ahlusar.ahluwalia@gmail.com> - 2015-06-17 13:20 -0700
  Re: JSON Object to CSV file Denis McMahon <denismfmcmahon@gmail.com> - 2015-06-21 06:45 +0000
    Re: JSON Object to CSV file sahluwalia@wynyardgroup.com - 2015-06-21 06:57 -0700
      Re: JSON Object to CSV file Denis McMahon <denismfmcmahon@gmail.com> - 2015-06-21 20:52 +0000
        Re: JSON Object to CSV file Sahlusar <ahlusar.ahluwalia@gmail.com> - 2015-06-21 16:38 -0700
    Re: JSON Object to CSV file Sahlusar <ahlusar.ahluwalia@gmail.com> - 2015-06-21 07:22 -0700
    Re: JSON Object to CSV file Sahlusar <ahlusar.ahluwalia@gmail.com> - 2015-06-21 07:54 -0700
      Re: JSON Object to CSV file Ned Batchelder <ned@nedbatchelder.com> - 2015-06-21 08:31 -0700
        Re: JSON Object to CSV file Sahlusar <ahlusar.ahluwalia@gmail.com> - 2015-06-21 08:39 -0700
  Re: JSON Object to CSV file ryguy7272 <ryanshuell@gmail.com> - 2015-08-19 18:54 -0700

csiph-web