Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 1.6 KB

README.md

File metadata and controls

26 lines (17 loc) · 1.6 KB

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)