Home

Awesome

pghero

pghero python port

– Work in progress.

Based on:

Installation

$ pip install pghero

Usage

from pghero.core import pghero
from sqlalchemy import create_engine 

db_path = 'postgres://username@host:port/db' 
db = create_engine(db_path)

pghero = pghero('sqlalchemy', db)
running_queries = pghero.running_queries() 
print running_queries

[out] => [86889, u'idle in transaction', datetime.timedelta(6, 21444, 452065), u'BEGIN', datetime.datetime(2014, 8, 3, 14, 6, 30, 186085, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=120, name=None))]