simpler access to metadata via observatory.cartodb.com

This commit is contained in:
John Krauss 2016-05-17 13:32:46 -04:00
parent 49d3962a54
commit 73200df38b
2 changed files with 4 additions and 4 deletions

View File

@ -16,4 +16,4 @@ to the test Observatory account.
Run automated tests against a hostname: Run automated tests against a hostname:
(venv) OBS_HOSTNAME=<hostname.cartodb.com> OBS_API_KEY=foobar OBS_META_HOSTNAME=<meta hostname> OBS_META_API_KEY=<meta api_key> nosetests scripts/autotest.py (venv) OBS_HOSTNAME=<hostname.cartodb.com> OBS_API_KEY=<api_key> OBS_META_HOSTNAME=observatory.cartodb.com OBS_META_API_KEY= nosetests scripts/autotest.py

View File

@ -25,19 +25,19 @@ def query(q, is_meta=False, **options):
return requests.get(url, params=params) return requests.get(url, params=params)
MEASURE_COLUMNS = [(r['id'], ) for r in query(''' MEASURE_COLUMNS = [(r['id'], ) for r in query('''
SELECT id FROM observatory.obs_column SELECT id FROM obs_column
WHERE type ILIKE 'numeric' WHERE type ILIKE 'numeric'
AND weight > 0 AND weight > 0
''', is_meta=True).json()['rows']] ''', is_meta=True).json()['rows']]
CATEGORY_COLUMNS = [(r['id'], ) for r in query(''' CATEGORY_COLUMNS = [(r['id'], ) for r in query('''
SELECT id FROM observatory.obs_column SELECT id FROM obs_column
WHERE type ILIKE 'text' WHERE type ILIKE 'text'
AND weight > 0 AND weight > 0
''', is_meta=True).json()['rows']] ''', is_meta=True).json()['rows']]
BOUNDARY_COLUMNS = [(r['id'], ) for r in query(''' BOUNDARY_COLUMNS = [(r['id'], ) for r in query('''
SELECT id FROM observatory.obs_column SELECT id FROM obs_column
WHERE type ILIKE 'geometry' WHERE type ILIKE 'geometry'
AND weight > 0 AND weight > 0
''', is_meta=True).json()['rows']] ''', is_meta=True).json()['rows']]