Skip to content

Instantly share code, notes, and snippets.

@tylernappy
Created October 19, 2016 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tylernappy/5c98f6fc479a484602a806176074a767 to your computer and use it in GitHub Desktop.
Save tylernappy/5c98f6fc479a484602a806176074a767 to your computer and use it in GitHub Desktop.
Text statistics using Python
from havenondemand.hodclient import *
client = HODClient("APIKEY", "v1")
# data = {'url': 'https://www.havenondemand.com/sample-content/documents/HP_License_terms_may2012.doc'} # uncomment if using publicy accessible URL
# data = {'file': 'path/to/file'} # uncomment if using local file
data = {'text': 'There are approximately 1,600 giant pandas (which is not a lot) left living in the wild.'} # uncomment if using raw text
response = client.post_request(data, 'gettextstatistics', async=False)
print response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment