Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
from ofxtools.Parser import OFXTree
from csv import DictWriter
from glob import glob
import sys
HEADER = ('date', 'amount', 'description', 'reference')
parser = OFXTree()
WITH parcel_ar AS (
SELECT cadastre.parcel_id, json_agg(json_build_object('ar_id', r.ar_id, 'year', r.year)) as ar_ids FROM cadastre JOIN role_p r on st_intersects(cadastre.wkb_geometry, r.geom) WHERE cadastre.parcel_id = '5618810' GROUP BY parcel_id
)
SELECT row_to_json(t)
FROM (
SELECT
parcel.parcel_id,
parcel_ar.ar_ids,
aq_lim_arrondissements.nomarr as borough,
aq_lim_municipales.nommun as city,