How to access local SDMX data file

86 views
Skip to first unread message

xing guo

unread,
Jul 17, 2016, 12:21:30 AM7/17/16
to Statistical data and metadata exchange with SDMX and Python
Hi,

I download a SDMX/XML data set from Fed, http://www.federalreserve.gov/datadownload/Output.aspx?rel=Z1&filetype=zip, which is a zip file. Then I follow the instruction in the document and did following lines:

from pandasdmx import Request

temp=Request()

temp.get(fromfile='FRB_Z1.zip')
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-6-61fb7469ca19> in <module>()
----> 1 temp.get(fromfile='FRB_Z1.zip')

C:\Users\xguob\AppData\Local\Enthought\Canopy\User\lib\site-packages\pandasdmx\api.pyc in get(self, resource_type, resource_id, agency, key, params, headers, fromfile, tofile, url, get_footer_url, memcache, writer)
    307                 # undo side effect of is_zipfile
    308                 source.seek(0)
--> 309             msg = self._get_reader().initialize(source)
    310         # Check for URL in a footer and get the real data if so configured
    311         if get_footer_url and hasattr(msg, 'footer'):

C:\Users\xguob\AppData\Local\Enthought\Canopy\User\lib\site-packages\pandasdmx\reader\sdmxml.pyc in initialize(self, source)
     43             cls = model.DataMessage
     44         else:
---> 45             raise ValueError('Unsupported root tag: %s' % root.tag)
     46         self.message = cls(self, root)
     47         return self.message


I could not figure out what's wrong going on here. Anyone can help me solve this problem? Also, I did not find any online examples about accessing the local SDMX data file. @dr leo, could you please provide us a demo example for this? Many thanks!

Best,
Reply all
Reply to author
Forward
0 new messages