ckanapi icon indicating copy to clipboard operation
ckanapi copied to clipboard

adding command line tool for dumping all metadata

Open ekzhu opened this issue 9 years ago • 11 comments

This address issue #98

ekzhu avatar Nov 15 '16 02:11 ekzhu

dump datasets is stable because its output is always ordered by package id, does this command have a stable ordering? If not, could you look at adding one? This should also help if concurrent updates, deletes, creations are happening

wardi avatar Nov 15 '16 17:11 wardi

The default sort order is 'relevance asc, metadata_modified desc', so a sort needs to be passed into the package_search call.

TkTech avatar Nov 15 '16 17:11 TkTech

package_id asc would be nice, then we can easily compare the output from dump datasets

wardi avatar Nov 15 '16 18:11 wardi

It looks like the metadata id field is called id instead package_id.

ekzhu avatar Nov 15 '16 18:11 ekzhu

This is excellent work.

Maybe calling it 'dump_datasets2' is a bit more specific than 'dump_metadata'?

davidread avatar Dec 07 '16 07:12 davidread

yes, sorry I've been slow in merging this. I like @davidread 's command-name suggestion. dump_datasets2 is better. We should document why you might want to use this command too (accessing sites like data.gov, because it's X% faster, etc..)

wardi avatar Dec 07 '16 16:12 wardi

Or even better: let's call this command search datasets and allow the parameters that are allowed to the package_search call to be provided (like you can with ckanapi action package_search ...) that makes this command much more useful and doesn't require strange naming or explanation (like "because data.gov...")

wardi avatar Jan 20 '17 15:01 wardi

Yes that would be even better, although perhaps we've messed the author around enough!

davidread avatar Jan 20 '17 15:01 davidread

I guess dump_dataset2 is better. I am not trying to add too many functionalities here. If you call it search dataset it still overlaps withpackage_search, and more confusing. Maybe it's better to reserve search ... for non-filtering based search such as key-word search.

ekzhu avatar Jan 24 '17 06:01 ekzhu

@ekzhu no worries, I'll finish this off if you're not interested in making my suggested change.

wardi avatar Jan 24 '17 14:01 wardi

dump is different from package_search, as dump can download resources too.

frafra avatar Feb 01 '22 14:02 frafra