action Package

action Package

Implementation of CKAN Action API takes place here.

get Module

libckan.logic.action.get.package_list(client=<libckan.model.client.Client object>)

Return a list of the names of the site’s datasets (packages).

Parameters:client (libckan.model.client.Client) – the CKAN Client. Default: an instance of libckan.model.client.Client
Returns:a Python list of Package objects
Return type:[libckan.model.package.Package]

Search for packages satisfying a given search criteria.

This action accepts solr search query parameters (details below), and returns a list of Packages that match the search criteria

Solr Parameters:

For more in depth treatment of each paramter, please read the Solr Documentation.

This action accepts a subset of solr’s search query parameters:

Parameters:
  • client (libckan.model.client.Client) – the CKAN Client. Default: an instance of libckan.model.client.Client
  • q (string) – the solr query. Optional. Default: “*:*”
  • fq (string) – any filter queries to apply. Note: +site_id:{ckan_site_id} is added to this string prior to the query being executed.
  • rows (int) – the number of matching rows to return.
  • sort (string) – sorting of the search results. Optional. Default: “score desc, name asc”. As per the solr documentation, this is a comma-separated string of field names and sort-orderings.
  • start (int) – the offset in the complete result for where the set of returned datasets should begin.
  • qf (string) – the dismax query fields to search within, including boosts. See the Solr Dismax Documentation for further details.
  • facet (string) – whether to enable faceted results. Default: “true”.
  • facet.mincount (int) – the minimum counts for facet fields should be included in the results.
  • facet.limit (int) – the maximum number of constraint counts that should be returned for the facet fields. A negative value means unlimited
  • facet.field (list of strings) – the fields to facet upon. Default empty. If empty, then the returned facet information is empty.
Returns:

a Python list of Package objects

Returns:

[libckan.model.package.Package]