0

I'm using the following python code, run through PuTTy, to call an API for some weather forecast data:

r = requests.get('http://datapoint.metoffice.gov.uk/public/data/val/wxfcs/all/xml/350509?res=3hourly&key=abc-123-mnb-0987') 

Please can anyone advise on the correct syntax to pipe this data straight through into HDFS (i'm running the HDF 2.4 sandbox on a VM)?

1

1 Answer 1

0

Something like this:

r = requests.get('http://datapoint.metoffice.gov.uk/public/data/val/wxfcs/all/xml/350509?res=3hourly&key=abc-123-mnb-0987') 
os.system('echo "%s" | hdfs dfs -copyFromLocal - /path/in/hdfs' %(r.text))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.