open-contracting / ocdskit

A suite of command-line tools for working with OCDS data
https://ocdskit.readthedocs.io
BSD 3-Clause "New" or "Revised" License
17 stars 7 forks source link

Merge record packages (and merge stream ordered by OCID) #114

Open jpmckinney opened 4 years ago

jpmckinney commented 4 years ago

Follow-up to #83

A user might have record packages to which they want to add compiled releases and/or versioned releases. With these as input, releases are already grouped by OCID. We can then skip the first phase of the merge function that groups releases by OCID.

We can already create a single record package from input record packages if we set --root-path records.item.releases.item, but we would lose package metadata and the individual packages. A new option/command is needed to preserve these.

If a release in a record is a linked release, we should error for now, given that requesting a remote release is an expensive operation.

Note: We can create a single record package from input individual records, using the command as-is (it'll be treated as a release package).


Similarly, if the user can already provide a list of release packages and/or individual releases such that releases with the same OCID are consecutive, they should be able to indicate this (e.g. with a --pre-grouped flag), and we can then skip the first phase of grouping releases by OCID.