1

Using python I want to collect a list of all possible dataflows from Eurostat. I have the following code;

from pandasdmx import Request as rq
estat=rq('ESTAT')
cat_rsp=estat.get(resource_type='dataflow')
cat_msg=cat_rsp.msg
print [i.encode('utf-8') for i in cat_msg.dataflows]

this gives me a list of all possible resource_id's but I want also the descriptors. Is this possible?

Thanks

Christophe Roussy
  • 16,299
  • 4
  • 85
  • 85
Nikki101
  • 69
  • 2
  • 8
  • Does `cat_msg` has the `descriptors` you want? – luoluo Sep 10 '15 at 11:17
  • I don't think so, how can I check that? – Nikki101 Sep 10 '15 at 11:41
  • No sorry,... Out[55]: ['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_elem', '_payload_names', '_reader', 'dataflows', 'header'] – Nikki101 Sep 10 '15 at 11:46

1 Answers1

0

Dataflow instances have a description attribute if that is what you're looking for.

print [i.description.en for i in cat_msg.dataflows]

Since Version 0.4 the preferred method is:

df = cat_rsp.write(columns=['name', 'description']).dataflow

This Returns a Pandas DataFrame that should contain descriptions on Dataflow instances.

Note that since version 0.4 the 'dataflows' Attribute of msg is deprecated in favor of 'dataflow'.

Leo

Gwen
  • 1,436
  • 3
  • 23
  • 31