Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

JSON output is malformed when running taxonkit list #30

Closed
4 tasks done
standage opened this issue Apr 27, 2020 · 4 comments
Closed
4 tasks done

JSON output is malformed when running taxonkit list #30

standage opened this issue Apr 27, 2020 · 4 comments

Comments

@standage
Copy link

Adding the --json flag to the example included in the documentation for taxonkit list produces output that is not well-formed JSON.

$ taxonkit list --json --ids 9605,239934 > result.json

This can be confirmed with a JSON linter like https://jsonlint.com/ or, as I discovered it, with Python's JSON parser.

>>> import json
>>> with open('result.json') as fh:
...   result = json.load(fh)
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/home/standage/anaconda3/envs/taxonkit/lib/python3.7/json/__init__.py", line 296, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/home/standage/anaconda3/envs/taxonkit/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/home/standage/anaconda3/envs/taxonkit/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/standage/anaconda3/envs/taxonkit/lib/python3.7/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 13 column 5 (char 149)
>>>

Prerequisites

  • make sure you're are using the latest version by taxonkit version
  • read the usage

Describe your issue

  • describe the problem
  • provide a reproducible example
shenwei356 added a commit that referenced this issue Apr 28, 2020
@shenwei356
Copy link
Owner

@standage
Copy link
Author

standage commented Apr 28, 2020

Looks great—I confirmed it's working on my end. Thanks for the prompt response!

@standage
Copy link
Author

I'm working on Python bindings for TaxonKit. Please let me know when a bugfix release is available from bioconda.

@shenwei356
Copy link
Owner

In 1-2 day.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants