How to convert sqlite format to CSV format?

0 votes

Hi everyone,

 I tried to read a SQLile format file. How can I convert SQLite format to CSV format?

Thank You

Feb 11 in Python by akhtar
• 10,330 points
320 views

1 answer to this question.

0 votes

Hi@akhtar,

If you want to read SQLite format with python language, then you have to install python-poster.

$ yum install python-poster

Then use the below code and run the file.

from poster.encode import multipart_encode
from poster.streaminghttp import register_openers
import urllib2
register_openers()
datagen, headers = multipart_encode({ 'files[]': open('sqlite file', 'rb')})
request = urllib2.Request('https://www.rebasedata.com/api/v1/convert', datagen, headers)
response = urllib2.urlopen(request)
if response.info().getheader('Content-Type') == 'application/json':
    print response.read()
    sys.exit(1)
with open('/tmp/result.zip', 'wb') as local_file:
    local_file.write(response.read())
print 'Conversion result successfully written to /tmp/result.zip!'

 
answered Feb 11 by MD
• 22,520 points

Related Questions In Python

+1 vote
1 answer

how to convert json to csv or to store in sql

You can convert JSON data to csv ...READ MORE

answered Jul 2, 2018 in Python by Nietzsche's daemon
• 4,260 points
257 views
0 votes
1 answer

How can I convert JSON to CSV?

I am not sure this question is ...READ MORE

answered Oct 1, 2018 in Python by aryya
• 7,350 points
7,034 views
+1 vote
1 answer

How to convert records from csv to a list in Python?

If you are using Python 3.x then ...READ MORE

answered Jun 25, 2019 in Python by Arvind
• 2,980 points

edited Jun 26, 2019 by Kalgi 478 views
+1 vote
1 answer

Python: convert txt file to csv format with rows and columns

This code should work. You have to ...READ MORE

answered Aug 1, 2019 in Python by Ashish
15,356 views
0 votes
0 answers

How can we use sqlite with WAL?

Can you give an example? READ MORE

May 29, 2019 in Python by Waseem
• 4,530 points

edited May 30, 2019 by Omkar 53 views
0 votes
0 answers

What is the use of cursor while querying a sqlite database?

I am completely new to sqlite, and ...READ MORE

Jul 4, 2019 in Python by Waseem
• 4,530 points
24 views
0 votes
1 answer

How to install python-poster in RedHat?

Hi@akhtar, To install python-poster in RedHat/CentOs, you can ...READ MORE

answered Feb 11 in Linux Administration by MD
• 22,520 points
74 views
0 votes
1 answer
0 votes
1 answer

How to convert one list into generator?

Hi@akhtar, Say, you have one list A. Now convert ...READ MORE

answered Apr 23 in Python by MD
• 22,520 points
46 views
0 votes
1 answer

How to convert a dataframe into list?

Hi@akhtar, You can convert your dataframe into list. ...READ MORE

answered Apr 24 in Python by MD
• 22,520 points
42 views