dataservices-api/server/lib/python/cartodb_services
2016-12-13 10:19:27 +01:00
..
cartodb_services The default isolines provider should be Mapzen 2016-12-13 10:19:27 +01:00
test Mapzen isochtrones integration 2016-11-29 12:57:23 +01:00
README.md Fix doc: how to run python unit tests #302 2016-11-08 17:52:18 +01:00
requirements.txt Added logger with rollbar integration 2016-08-01 18:03:42 +02:00
setup.py New version of the python lib #317 2016-12-07 16:39:28 +01:00

CARTO dataservices API python module

This directory contains the python library used by the server side of CARTO LDS (Location Data Services).

It is used from pl/python functions contained in the cdb_dataservices_server extension. It goes hand in hand with the extension so please consider running the integration tests.

On the other hand, it is pretty independent from the client, as long as the signatures of the public pl/python functions match.

Dependencies

See the [[requirements.txt]] or better the Basically:

  • pip
  • redis and hiredis
  • dateutil
  • googlemaps
  • request

Installation

Install the requirements:

sudo pip install -r requirements.txt

Install the library:

sudo pip install .

NOTE: a system installation is required at present because the library is meant to be used from postgres pl/python, which runs an embedded python interpreter.

Running the unit tests

Just run nosetests test/

$ nosetests test/
......................................................................................................
----------------------------------------------------------------------
Ran 102 tests in 0.122s

OK

Running the integration tests

See the ../../../../test/README.md. Basically, move to the /test directory at the top level of this repo and execute the run_tests.py script:

cd $(git rev-parse --show-toplevel)/test
python run_tests.py --host=$YOUR_HOST $YOUR_USERNAME $YOUR_API_KEY

TODO

  • Move dependencies expressed in requirements.txt to setup.py