PAIRS Python SDK

Welcome to the PAIRS API reference. PAIRS is a geospatial big data service platform built by IBM research team. The PAIRS API is organized around the REST methodology and it uses resource-oriented URLs, and common HTTP response codes to indicate API errors. It uses JSON as the default encoding. Most of the methods you will find here are publicly available but there are some that will require you to be authenticated as a user in the platform

This Python package is automatically generated by the Swagger Codegen project:

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

If the python package is hosted on Github, you can install directly from Github

pip install git+https://github.ibm.com/IBMResearch/pairs-mvp2-api.git

(you may need to run pip with root permission: sudo pip install git+https://github.ibm.com/IBMResearch/pairs-mvp2-api.git)

Then import the package:

import pairs_sdk 

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import pairs_sdk

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function
import time
import pairs_sdk
from pairs_sdk.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = pairs_sdk.ColorScaleApi()

try:
    # Returns the list of available color scales
    api_response = api_instance.colorscales_get()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ColorScaleApi->colorscales_get: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://ibmpairs-mvp2-api.mybluemix.net

Class Method HTTP request Description
ColorScaleApi colorscales_get GET /colorscales Returns the list of available color scales
DataSetApi datasets_dataset_id_datalayers_get GET /datasets/{datasetId}/datalayers Returns all data layers in a data set
DataSetApi datasets_dataset_id_get GET /datasets/{datasetId} Find data set by id
DataSetApi datasets_get GET /datasets Returns all available data sets
PolygonApi polygons_get GET /polygons Returns all polygons
PolygonApi polygons_polygon_id_geometry_get GET /polygons/{polygonId}/geometry Returns the geometry of the selected polygon
PolygonApi polygons_polygon_id_get GET /polygons/{polygonId} Returns a single polygon
QueryJobApi example_queryjobs_get GET /example-queryjobs Find and return all sample query jobs
QueryJobApi queryjobs_get GET /queryjobs Find all user query jobs
QueryJobApi queryjobs_post POST /queryjobs Submits a new query
QueryJobApi queryjobs_query_job_id_delete DELETE /queryjobs/{queryJobId} Delete query job by id
QueryJobApi queryjobs_query_job_id_get GET /queryjobs/{queryJobId} Find query job by id
QueryJobApi queryjobs_query_job_id_settings_put PUT /queryjobs/{queryJobId}/settings Changes the settings for a query job
QueryJobApi queryjobs_sizeestimation_post POST /queryjobs/sizeestimation Returns an estimation in bytes of the size of the query job
TimeSeriesApi timeseries_data_layer_id_get GET /timeseries/{dataLayerId} Returns a time series for a data layer
UserApi me_get GET /me Returns the current user
UserApi me_post POST /me Accepts the terms and conditions
UserApi users_login_get GET /users/login Authenticates a user with an 3rd party provider
UserApi users_login_post POST /users/login Authenticates a user with email and password
UserApi users_logout_post POST /users/logout Deauthenticates a user

Documentation For Models

Documentation For Authorization

accessToken

Author

Áxel Hernández Ferrera & Sergio Gutiérrez Mota