Skip to content

lfucg/ckan-datapackages

Repository files navigation

Use dpm to (re)create a CKAN resource and push the data to it

Will create the package - deleting first if it exists - and insert the data defined in lexington-code-enforcement-complaints/datapackage.json

If the lexington-code-enforcement-complaints package exists in CKAN and a resource exists, its data will be completely recreated based on values of lexington-code-enforcement-complaints.csv but the resource id stays the same. This is handy so that we don't have to change the CKAN resource ids that our ETL process upserts to.

Caveat: Recreating the datasets will change the _id column that CKAN assigns. If Citygram has already consumed the event feed then the 'StatusLex' link that use the _id column will point to the wrong listing.

npm install datapackage -g
cd lexington-code-enforcement-complaints
dpm ckan civicdata --owner_org=lexington-ky

Same for building permits:

cd lexington-building-permits
dpm ckan civicdata --owner_org=lexington-ky

In order to upsert the data rather than first deleting and recreating the resource

I edited the datapackage-ckan/index.js dependency of datapackage.

(npm install datapackage -g on OSX puts the file here: /usr/local/lib/node_modules/datapackage/node_modules/datapackage-ckan/index.js)

About

Home to configurations for CKAN datapackages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published