Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7800713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:43:36+00:00 2026-06-02T00:43:36+00:00

I have a mission to convert sqlite3 data to Json format and CSV format,

  • 0

I have a mission to convert sqlite3 data to Json format and CSV format, I can read the data like this (line breaks added):

(2966, 
 u'http://buy.xineurope.com/thread-394248-1-1.html', 
 u'\u6d77\u666f\u623f\u627e\u4eba\u5408\u79df - \u623f\u5c4b\u4fe1\u606f - \u8df3\u86a4\u5e02\u573a - \u65b0\u6b27\u6d32-XinEurope-\u534e\u4eba\u4fe1\u606f\u5a31\u4e50\u4e92\u52a8\u95e8\u6237 - Powered by Discuz!', 
 1, 0, 12979085330693664L, 0, 0)

Is there some tools or modules (import json?) that help me to transfer, and the most import thing is what are the formats about json and CSV, could you give me a example use the data above?

Just like, I create a dict {‘a’:dad,’b’:dada}, but in json format?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T00:43:37+00:00Added an answer on June 2, 2026 at 12:43 am

    To convert to json, whether it’s one row or cursor.fetchall():

    import json
    
    json_data = json.dumps(data)
    

    or use json.dump(some_file_object, data) if you want to store it to a file.

    To convert to csv:

    import csv
    
    writer = csv.writer(some_file_object)
    
    for row in cursor:
        # the csv module can't handle unicode, so encode the strings
        row = [item.encode('utf-8') if isinstance(item, basestring) else item 
                                                                    for item in data]
        writer.writerow(row)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a game in RoR. The game breaks down like this. There are
Currently, I have 20+ URLs on my site in this format http://www.example.net/content/index/mission I want
I have a long string from android Http get like this: {movies:[ {movieId:fmen71229238,eTitle:Mission: Impossible
I have an application that can not afford to lose data, so Postgresql is
I have next mission: i have to replace flash alement with javascript in this
I have a big xml document that looks like this: <Node name=foo> <Node name=16764764625>
Working on a pet project concerning efficiency and data and this is the mission
I have this class: @interface Mission : BaseModel { NSString *Description; NSDate *EndDate; NSMutableArray
Have a look at this picture alt text http://www.abbeylegal.com/downloads/2009-04-01/web%20part%20top%20line.jpg Does anyone know what css
I have the mission to make a small game for a school project. Pictures

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.