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, 2020 in Python by akhtar
• 38,180 points
1,733 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, 2020 by MD
• 95,220 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
597 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,440 points
10,032 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
• 3,000 points

edited Jun 26, 2019 by Kalgi 6,073 views
+1 vote
4 answers

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

Python will read data from a text ...READ MORE

answered Dec 13, 2020 in Python by Gitika
• 65,910 points
38,770 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,540 points

edited May 30, 2019 by Omkar 129 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,540 points
79 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, 2020 in Linux Administration by MD
• 95,220 points
182 views
0 votes
1 answer
0 votes
1 answer

How to convert CSV file to JSON file using Pandas?

Hi@akhtar, You can convert your CSV file to ...READ MORE

answered Jun 25, 2020 in Python by MD
• 95,220 points
3,112 views
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, 2020 in Python by MD
• 95,220 points
595 views