From 916a82b2277dabdea40507bb00b6c708d2b98543 Mon Sep 17 00:00:00 2001 From: Madison May Date: Thu, 18 Dec 2014 15:38:08 -0500 Subject: [PATCH] Batch support bug fixes --- .travis.yml | 24 ------------------------ CHANGES.txt | 3 ++- README.md | 8 ++++++++ indicoio/__init__.py | 2 +- indicoio/utils/__init__.py | 3 ++- setup.py | 2 +- 6 files changed, 14 insertions(+), 28 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f08471e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: python -python: - - 2.7 - -# Setup anaconda -before_install: - - wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh - - chmod +x miniconda.sh - - ./miniconda.sh -b - - export PATH=/home/travis/miniconda/bin:$PATH - - conda update --yes conda - # The next couple lines fix a crash with multiprocessing on Travis and are not specific to using Miniconda - - sudo rm -rf /dev/shm - - sudo ln -s /run/shm /dev/shm - -# Install packages -install: - - conda install --yes python=$TRAVIS_PYTHON_VERSION atlas numpy scipy matplotlib nose dateutil pandas statsmodels requests requests six scikit-image - - python setup.py install - -# Run test -script: - - nosetests -w ./tests/remote - \ No newline at end of file diff --git a/CHANGES.txt b/CHANGES.txt index 3cfc560..67a8c7d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -13,4 +13,5 @@ v0.4.4, Thu Sep 25 -- Added dependencies installation to setup.py v0.4.5, Thu Sep 25 -- Added interface to local indico server v0.4.6, Fri Oct 27 -- Updated to point to new indico api servers, cleaner REST API v0.4.8, Fri Nov 7 -- Updated API interface to include new text tags API -v0.4.11, Wed Dec 18 -- Updated tests for text tags \ No newline at end of file +v0.4.11, Wed Dec 18 -- Updated tests for text tags +v0.4.12, Thu Dec 19 -- Added batch support interface \ No newline at end of file diff --git a/README.md b/README.md index 637556b..38cecde 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,14 @@ If you have a local indico server running, simply import from `indicoio.local`. >>> from indicoio.local import political, sentiment, fer, facial_features, language ``` +If you'd like to use our batch api interface, please send an email to contact@indico.io. + +``` +>>> from indicio import batch_sentiment +batch_sentiment(['Text to analyze', 'More text'], auth=("example@example.com", "********")) +``` + + Installation ------------ ``` diff --git a/indicoio/__init__.py b/indicoio/__init__.py index 6527b6e..c8c3548 100644 --- a/indicoio/__init__.py +++ b/indicoio/__init__.py @@ -3,7 +3,7 @@ import indicoio.config as config JSON_HEADERS = {'Content-type': 'application/json', 'Accept': 'text/plain'} -Version, version, __version__, VERSION = ('0.4.11',) * 4 +Version, version, __version__, VERSION = ('0.4.12',) * 4 from indicoio.text.sentiment import political, posneg from indicoio.text.sentiment import posneg as sentiment diff --git a/indicoio/utils/__init__.py b/indicoio/utils/__init__.py index c96296c..0369dc5 100644 --- a/indicoio/utils/__init__.py +++ b/indicoio/utils/__init__.py @@ -24,7 +24,8 @@ def api_handler(arg, url, batch=False, auth=None): data_dict = json.dumps({'data': arg}) if batch: url += "/batch" - auth = auth_query() + if not auth: + auth = auth_query() response = requests.post(url, data=data_dict, headers=JSON_HEADERS, auth=auth).json() results = response.get('results', False) if not results: diff --git a/setup.py b/setup.py index ec598f1..2edb68a 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ except ImportError: setup( name="IndicoIo", - version='0.4.11', + version='0.4.12', packages=[ "indicoio", "indicoio.text",