Skip to content

Commit

Permalink
Added a Wrapper function to convert CKAN tags to POD keywords array
Browse files Browse the repository at this point in the history
Fixes GSA#29
  • Loading branch information
inghamn committed Oct 17, 2016
1 parent b821f88 commit c569297
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ckanext/datajson/package2pod.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,25 @@ def __init__(self):
@staticmethod
def ckan_url_for_dataset_id(id):
"""Returns canonical URL to the provided dataset
id -- The UUID for a CKAN dataset
Returns a URL string
"""
import pylons.config as config
url = config.get('ckan.site_url') + '/dataset/' + id
return url

@staticmethod
def ckan_tags_to_keywords(tags):
"""Converts core CKAN tags to a Keywords array
tags -- The tags dictionary from the CKAN package
Returns a list of keyword strings
"""
return list(t['display_name'] for t in tags)


@staticmethod
def catalog_publisher(value):
Expand Down

0 comments on commit c569297

Please sign in to comment.