Git Product home page Git Product logo

jsoncsv's People

Contributors

alingse avatar thttnt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

jsoncsv's Issues

Wrong field order

When I use the command line conver the following lines:
{"english": "Slowly and not without struggle, America began to listen.", "chinese": "美国缓慢地开始倾听,但并非没有艰难曲折。"}
{"english": "I didn't own a Thesaurus until four years ago and I use a small Webster's dictionary that I'd bought at K-Mart for 89 cents.", "chinese": "直到四年前我才有了一本词典。我使用的是用89美分在K市场里买来的一本韦氏小词典。我从来不使用单词处理程序。"}
{"english": "portlet, you must write three short deployment descriptors: web.xml, portlet.xml, and geronimo-web.xml. (Some of these may have been generated by your IDE.)", "chinese": "portlet 之后,您必须编写三个简短的部署描述符:web.xml、portlet.xml 和 geronimo-web.xml(这其中的一些文件可能已经由 IDE 生成)。"}

I get the result in an inversed order:
chinese,english
美国缓慢地开始倾听,但并非没有艰难曲折。,"Slowly and not without struggle, America began to listen."
直到四年前我才有了一本词典。我使用的是用89美分在K市场里买来的一本韦氏小词典。我从来不使用单词处理程序。,I didn't own a Thesaurus until four years ago and I use a small Webster's dictionary that I'd bought at K-Mart for 89 cents.
portlet 之后,您必须编写三个简短的部署描述符:web.xml、portlet.xml 和 geronimo-web.xml(这其中的一些文件可能已经由 IDE 生成)。,"portlet, you must write three short deployment descriptors: web.xml, portlet.xml, and geronimo-web.xml. (Some of these may have been generated by your IDE.)"

ubuntu 16.04 cat in.json | jsoncsv | mkexcel > out.csv ERROR

ubuntu 16.04
cat in.json | jsoncsv | mkexcel > out.csv

ERROR

Traceback (most recent call last):
File "/usr/local/bin/jsoncsv", line 9, in
load_entry_point('jsoncsv==2.0.8', 'console_scripts', 'jsoncsv')()
File "/usr/local/lib/python2.7/dist-packages/click-6.7-py2.7.egg/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click-6.7-py2.7.egg/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/dist-packages/click-6.7-py2.7.egg/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python2.7/dist-packages/click-6.7-py2.7.egg/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "build/bdist.linux-x86_64/egg/jsoncsv/main.py", line 50, in jsoncsv
File "/usr/lib/python2.7/json/init.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 380, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting object: line 1 column 3 (char 2)

THANKS

Getting exception when running Json to CSV tool

Am using centOS 7 and using python 2.7. Am getting following exception when try to convert json to CSV

[root@SIQ4L_6709 jsoncsv-2.2.4]# cat exportAttributes_matter.json | jsoncsv | mkexcel > output.csv
Traceback (most recent call last):
File "/usr/bin/jsoncsv", line 9, in
load_entry_point('jsoncsv==2.2.4', 'console_scripts', 'jsoncsv')()
File "/usr/lib/python2.7/site-packages/click-7.1.1-py2.7.egg/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/click-7.1.1-py2.7.egg/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/lib/python2.7/site-packages/click-7.1.1-py2.7.egg/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python2.7/site-packages/click-7.1.1-py2.7.egg/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "build/bdist.linux-x86_64/egg/jsoncsv/main.py", line 60, in jsoncsv
File "build/bdist.linux-x86_64/egg/jsoncsv/jsontool.py", line 160, in convert_json
File "build/bdist.linux-x86_64/egg/jsoncsv/jsontool.py", line 145, in gen_objs
File "/usr/lib64/python2.7/json/init.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.7/json/decoder.py", line 382, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting object: line 1 column 2 (char 1)

设置header

你好,感谢你分享这个repo。请问如何把key作为csv文件中的header。
{"abstract": "xxxxx", "authors": ["a", "b", "c"], "references": ["1", "2"], "title": "aaaaa"}

abstract authors1 author2 author3 references1 reference2 title
xxxxx a b c 1 2 aaaaa

谢谢!

mkexcel -t xls write dict fail

echo '{"": {}}'|mkexcel -t xls > x.xls
-------
    raise Exception("Unexpected data type %r" % type(label))
Exception: Unexpected data type <class 'dict'>
echo '{"": {}}'|mkexcel -t csv                                                                                            1 ↵
""
""

TODO:

中文windows 7 64位+python3.6.5 环境下pip安装(2.0.7版)失败

C:\Users\Roy>pip install jsoncsv
Collecting jsoncsv
Downloading https://files.pythonhosted.org/packages/a1/31/eb4c78c2f9a57ac29ff6
2b12a3c7a5cb48b762b7c0362b6c4a152b721d7c/jsoncsv-2.0.7.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Roy\AppData\Local\Temp\pip-install-jblltyy7\jsoncsv\setup.p
y", line 12, in
readme = f.read()
UnicodeDecodeError: 'gbk' codec can't decode byte 0x9a in position 1115: ill
egal multibyte sequence

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in C:\Users\Roy\AppD
ata\Local\Temp\pip-install-jblltyy7\jsoncsv\

Python下使用的问题

编程新人。python3(spider)+windows下使用,最后一行错误SyntaxError: invalid syntax

code如下:
import os
import sys
import json
import jsoncsv

file_dir = '../data/raw/103_course_content/02_course_bought_together/9287.json'

cat 9287.json |jsoncsv |mkexcel > output.csv

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.