easy rest api包装器
rieapie的Python项目详细描述
简介
使用rieapie访问googlemapsrestapi的示例。
importrieapiegmap=rieapie.Api("http://maps.googleapis.com/maps/api")args={"origin":"Toronto","destination":"Montreal","avoid":"highways","mode":"bicycling","sensor":"false"}directions=gmap.directions.json.get(**args)printdirections["routes"][0]["bounds"]
使用提供的twitter包装器访问twitter api的示例。
importrieapieparams={"consumer_key":"...","consumer_secret":"..."}# or if you want to provide an access tokenparams={"consumer_key":"...","consumer_secret":"...","access_token":"..",,"access_token_secret":".."}twitter=rieapie.wrappers.Twitter(**params)timeline=twitter.statuses.user_timeline(ext="json")# or if you prefer this syntaxtimeline=twitter.statuses["user_timeline.json"]forstatusintimeline.get(count=10,screen_name="mybestfriend"):printstatus['text']
为什么是“里亚皮”?
- [r]est[i]s[e]asy[a]s[p]ython[i]s[e]asy
- [r]est[i]s[e]asy[a]s[pie]
- [r]est[i]s[e]asy[api]…[e]asy