[ckan-dev] python ckanclient querying multiple tags

Sean Hammond sean.hammond at okfn.org
Thu May 10 10:20:55 UTC 2012


> 
> I'm trying to use the python ckanclient [1] to query for datasets with a certain set of multiple tags.
> 
> Based on [2], I was able to cobble together a successful URL query:
> 
> (A)
> http://thedatahub.org/api/search/dataset?q=tags:helpme&tags:lod
> 
> 
> 
> But how to call this through the ckanclient?
> 
> The following works to get one tag:
> self.ckan.package_search('tags:helpme')
> 
> but neither of these works to results similar to (A) above:
> self.ckan.package_search('tags:helpme&tags:lod') 
> self.ckan.package_search('tags:helpme&tags:lod')
> self.ckan.package_search([ 'tags:helpme', tags:lod' ] )
> 
> What is the appropriate query string to give package_search to get datasets with multiple tags?

Hi Tim, does this do what you want?

    ckan.package_search('tags:helpme+tags:lod')




More information about the ckan-dev mailing list