mirror of
https://github.com/wassname/IndicoIo-python.git
synced 2026-08-14 12:00:31 +08:00
Merge pull request #81 from IndicoDataSolutions/development
Development
This commit is contained in:
@@ -28,3 +28,4 @@ v0.7.1 Thu Jun 11 -- High quality sentiment API for private beta, fix for multi
|
|||||||
v0.7.2 Thu Jun 11 -- Remove sentiment_hq from text apis by default
|
v0.7.2 Thu Jun 11 -- Remove sentiment_hq from text apis by default
|
||||||
v0.7.3 Wed Jun 17 -- Fixes for handling of specific image types
|
v0.7.3 Wed Jun 17 -- Fixes for handling of specific image types
|
||||||
v0.7.4 Mon Jun 22 -- Fix for setup.py issues
|
v0.7.4 Mon Jun 22 -- Fix for setup.py issues
|
||||||
|
v0.7.5 Wed Jul 1 -- Public access to sentimentHQ api
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
Version, version, __version__, VERSION = ('0.7.4',) * 4
|
Version, version, __version__, VERSION = ('0.7.5',) * 4
|
||||||
|
|
||||||
JSON_HEADERS = {
|
JSON_HEADERS = {
|
||||||
'Content-type': 'application/json',
|
'Content-type': 'application/json',
|
||||||
|
|||||||
@@ -29,11 +29,6 @@ def api_handler(arg, cloud, api, url_params = {"batch":False, "api_key":None}, *
|
|||||||
if apis:
|
if apis:
|
||||||
url += "&apis=%s" % ",".join(apis)
|
url += "&apis=%s" % ",".join(apis)
|
||||||
|
|
||||||
# private beta
|
|
||||||
if host == config.PUBLIC_API_HOST:
|
|
||||||
if (api == 'sentimenthq') or ('sentimenthq' in apis):
|
|
||||||
raise IndicoError("The high quality sentiment API is currently in private beta.")
|
|
||||||
|
|
||||||
response = requests.post(url, data=json_data, headers=JSON_HEADERS)
|
response = requests.post(url, data=json_data, headers=JSON_HEADERS)
|
||||||
if response.status_code == 503 and cloud != None:
|
if response.status_code == 503 and cloud != None:
|
||||||
raise IndicoError("Private cloud '%s' does not include api '%s'" % (cloud, api))
|
raise IndicoError("Private cloud '%s' does not include api '%s'" % (cloud, api))
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
six>=1.3.0
|
six>=1.3.0
|
||||||
requests>=2.2.1
|
requests>=2.2.1
|
||||||
Pillow>=2.8.1
|
Pillow>=2.8.2
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ except ImportError:
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="IndicoIo",
|
name="IndicoIo",
|
||||||
version="0.7.4",
|
version="0.7.5",
|
||||||
packages=[
|
packages=[
|
||||||
"indicoio",
|
"indicoio",
|
||||||
"indicoio.text",
|
"indicoio.text",
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ class FullAPIRun(unittest.TestCase):
|
|||||||
response = political(test_string)
|
response = political(test_string)
|
||||||
|
|
||||||
self.assertTrue(isinstance(response, dict))
|
self.assertTrue(isinstance(response, dict))
|
||||||
assert response['Liberal'] > 0.25
|
assert response['Libertarian'] > 0.25
|
||||||
|
|
||||||
def test_posneg(self):
|
def test_posneg(self):
|
||||||
test_string = "Worst song ever."
|
test_string = "Worst song ever."
|
||||||
|
|||||||
Reference in New Issue
Block a user