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

New command: detect-format #94

Closed jpmckinney closed 5 years ago

jpmckinney commented 5 years ago

For each file/input, returns whether it is a release, record package, or release package.

jpmckinney commented 5 years ago

This can also return whether the input file is line-delimited JSON, a JSON array or a JSON object.

duncandewhurst commented 5 years ago

+1 this would be really useful and simplify our conversations with OCDS users about how to determine the structure of the JSON file they are working with

jpmckinney commented 5 years ago

This command would take a filename as input, rather than read from stdin, since a user typically wants to know the format of a file (not the formats of many items in a stream).