Advertisement
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():
- client.connect()
- my_database = client['newssentiment']
- # document_id
- news = my_database[document_id]
- client.disconnect()
- # json to string
- news = json.dumps(news)
- return news;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement