dataservices-api/server/lib/python/cartodb_services
Juan Ignacio Sánchez Lara a32e90ea8a carto-package.json proposal
2018-08-02 12:59:45 +02:00
..
cartodb_services Better debug message 2018-07-24 11:57:54 +02:00
test WELL_KNOWN_SHAPE and WELL_KNOWN_LENGTH fixture update 2018-07-25 11:22:31 +02:00
__init__.py Bulk geocoding refactor 2018-06-29 14:59:07 +02:00
carto-package.json carto-package.json proposal 2018-08-02 12:59:45 +02:00
README.md Update README.md 2018-02-14 11:03:51 +01:00
requirements.txt Added CR suggestions 2018-01-04 12:30:58 +01:00
setup.py Python library version 0.19.1 2018-07-24 11:59:29 +02: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

Take a look at requirements.txt for details about the required dependencies.

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 MAPBOX_API_KEY=xxx nosetests test/

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

OK

Running the integration tests

See this README in the /test directory for details. Basically, you have to 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

Versioning

Once you're satisfied with your changes, it is time to bump the version number in the setup.py. A couple of rules:

  • Backwards compatibility: in general all changes shall be backwards compatible. Do not remove any code used from the server public pl/python functions or you'll run into problems when deploying.
  • Semantic versioning: we try to stick to Semantic Versioning 2.0.0