Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

MobilityDB Driver

Project description

# MobilityDB-Python MobilityDB helpers for PostgreSQL driver.

Install

pip install MobilityDB

Requirements

  • MobilityDB
  • PostgreSQL Driver (psycopg)
  • Python packages (postgis, bdateutil)

Usage

1- Register MobilityDB extension in PostgreSQL driver:

import MobilityDB connectionObject = psycopg2.connect(host=’localhost’, database=’db’, user=’postgres’, password=’’) MobilityDBRegister(connectionObject)

2- Retrieve MobilityDB types as python objects:

cursor.execute(‘SELECT tpoint from tpointseq;’) colVal = cursor.fetchone()[0] print(colVal)

—Result is an object of TGEOMPOINTSEQ type: –TGEOMPOINT(SEQUENCE)’[POINT(1.0 2.0)@2019-09-08 00:00:00+02:00, POINT(0.0 2.0)@2019-09-09 00:00:00+02:00, POINT(1.0 1.0)@2019-09-10 00:00:00+02:00]’

Project details


Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page