Package ‘Specs’ (Specifications)

class datapkg.spec.Spec(scheme='file', netloc='', path='')

A “spec” is a string identifying a package within a package index (or, sometimes, just the index).

It therefore combines index/repository information with an identifier for that package within the index. It is directly based on URIs.

Spec strings start with as ‘scheme’ part identifying the type of index and then have additional information used to specify the package (and perhaps the index). For example, for the 3 types of index currently available:

ckan://{package-name}
file://{index-path}/{package-name}
db://{packag-name} 

Examples:

ckan://datapkgdemo # datapkgdemo package in the CKAN index
file:///some/path/on/disk
file://. # current directory
file://./xyz # relative path xyz from the current directory
db://datapkgdemo # datapkgdemo in the (local) database index

For the convenience of users we also support a default index (set in the config file). This allows one to simply use the package identifier for the spec, e.g.:

datapkgdemo

Previous topic

Datapkg API

Next topic

Distributions

This Page