a guest Sep 26th, 2016 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- from cloudant.client import Cloudant
- import json
- username = "<cloudant_username>"
- password = "<cloudant_password>"
- cloudantURL = "<cloudant_url>"
- client = Cloudant(username, password, url=cloudantURL)
- document_id = '<cloudant_document_id>'
- def GetNews():
- my_database = client['newssentiment']
- # document_id
- news = my_database[document_id]
- # json to string
- news = json.dumps(news)
- return news;
RAW Paste Data