简体   繁体   English

有没有办法使用python将一个大的json文件转换成csv格式

[英]Is there a way to convert a big json file into csv format using python

I have a big data of json around 7 GB, and I want to convert it into CSV for a better understanding of data.我有一个大约 7 GB 的 json 大数据,我想将其转换为 CSV 以便更好地理解数据。 there is more than one json object in my dataset.我的数据集中有多个 json 对象。

The following is the first object of my data.以下是我的数据的第一个对象。

{
    '_id': {
        '$oid': '575feb01aea6d60d0209eb98'
    },
    'user': {
        'profile_background_image_url': 'http://abs.twimg.com/images/themes/theme1/bg.png',
        'id': {
            '$numberLong': '3365483769'
        },
        'profile_link_color': '0084B4',
        'id_str': '3365483769',
        'lang': 'el',
        'created_at': 'Wed Jul 08 07:10:52 +0000 2015',
        'friends_count': 404,
        'profile_text_color': '333333',
        'profile_background_image_url_https': 'https://abs.twimg.com/images/themes/theme1/bg.png',
        'listed_count': 2,
        'profile_background_color': 'C0DEED',
        'profile_image_url_https': 'https://pbs.twimg.com/profile_images/742575018157182976/9Vq7CsJZ_normal.jpg',
        'default_profile': True,
        'screen_name': 'kottara2',
        'geo_enabled': True,
        'followers_count': 70,
        'name': 'Dr. ΑΝΤΡΕΑΣ',
        'statuses_count': 1008,
        'profile_image_url': 'http://pbs.twimg.com/profile_images/742575018157182976/9Vq7CsJZ_normal.jpg',
        'profile_sidebar_fill_color': 'DDEEF6',
        'profile_sidebar_border_color': 'C0DEED',
        'profile_use_background_image': True,
        'profile_banner_url': 'https://pbs.twimg.com/profile_banners/3365483769/1465878634',
        'favourites_count': 517
    },
    'place': {
        'bounding_box': {
            'coordinates': [
                [
                    [19.372958, 34.802021],
                    [19.372958, 41.748536],
                    [29.644764, 41.748536],
                    [29.644764, 34.802021]
                ]
            ],
            'type': 'Polygon'
        },
        'country_code': 'GR',
        'id': '2ee7eeaa84dbe65a',
        'name': 'Ελλάς',
        'url': 'https://api.twitter.com/1.1/geo/id/2ee7eeaa84dbe65a.json',
        'country': 'Ελλάς',
        'full_name': 'Ελλάς',
        'place_type': 'country'
    },
    'id': {
        '$numberLong': '742680788190257152'
    },
    'timestamp_ms': '1465903872903',
    'source': '<a href="http://twitter.com" rel="nofollow">Twitter Web Client</a>',
    'text': 'ΑΛΗΤΗ  ΤΣΙΠΡΑ  ΔΕΝ  ΕΧΕΙΣ  ΟΥΤΕ  ΤΣΙΠΑ  !!!',
    'filter_level': 'low',
    'id_str': '742680788190257152',
    'lang': 'el',
    'created_at': {
        '$date': '2016-06-14T11:31:12.000Z'
    }
}

I want a .CSV format我想要一个 .CSV 格式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM