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

Error executing the command #58

Closed JArielMG closed 5 years ago

JArielMG commented 5 years ago

Command: cat Documentos/json_release_package/*.json | ocdskit combine-release-packages > out.json

Error: Traceback (most recent call last): File "/usr/local/bin/ocdskit", line 11, in load_entry_point('ocdskit==0.0.2', 'console_scripts', 'ocdskit')() File "/usr/local/lib/python3.6/site-packages/ocdskit/cli/main.py", line 48, in main command.handle() File "/usr/local/lib/python3.6/site-packages/ocdskit/cli/commands/combine_release_packages.py", line 15, in handle package = json.loads(line, object_pairs_hook=OrderedDict) File "/usr/local/lib/python3.6/json/init.py", line 367, in loads return cls(**kw).decode(s) File "/usr/local/lib/python3.6/json/decoder.py", line 342, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 1 column 3855 (char 3854)

jpmckinney commented 5 years ago

This is due to a JSON error. For example, here's JSON data with an extra semi-colon:

echo '{"test": 1};' | ocdskit combine-release-packages

Please check that each file is valid JSON first.

jpmckinney commented 5 years ago

Also, is the JSON data line-delimited? If not, you may need to pipe it through jq -crM .