Questions tagged [tablib]

Tablib is Python tabular dataset library. It allows you to import, export, and manipulate tabular data sets.

Tablib is Python tabular dataset library. It allows to import, export, and manipulate tabular data sets.

Documentation: http://docs.python-tablib.org

16 questions
11
votes
1 answer

python 3.5 -> 3.6 Tablib TypeError: cell() missing 1 required positional argument: 'column'

Migrating from python 3.5 to 3.6, my unit tests reveal a problem with django-import-export & tablib: TypeError: cell() missing 1 required positional argument: 'column' File "/lib/python3.6/site-packages/tablib/formats/_xlsx.py", line 122, in…
Davy
  • 1,720
  • 1
  • 19
  • 42
3
votes
1 answer

How to save tablib dataset as csv file?

I have created a dataset using tablib. out_dict is a dictionary file headers = out_dict.keys() data = tablib.Dataset(out_dict.values(), headers=headers) How can I save it as a csv file in the same format?
2
votes
1 answer

Tablib xlsx file badZip file issue

I am getting error on opening xlsx extension file in windows 8 using tablib library. python version - 2.7.14 error is as follows: python suit_simple_sheet_product.py Traceback (most recent call last): File "suit_simple_sheet_product.py", line 19,…
Raja Bose
  • 344
  • 2
  • 8
2
votes
0 answers

Is there a way to format tables by applying text wrap down and setting the column size in xls using tablib library of python

I used python library tablib v0.10.0. I have a document which has a column with each row containing large amount of text. But after I generated the document I found that it is not as beautified or formatted as I want it to be. I basically want to…
Swathi Harish
  • 61
  • 1
  • 5
2
votes
2 answers

(Python) Change pagesize and format of PDF file generated with xtopdf

I want to convert an xlsx with Python. I used the modules tablib and xtopdf to build a well structured table. Works excellent! Unfortunately the content does not fit on one pdf page. So I wanted to change the pagesize and format to horizontal A3.…
Felix
  • 115
  • 2
  • 12
1
vote
1 answer

Creating a tablib Dataset using a URL that points to a .csv file

I am trying to use the tablib library and create a Dataset from a .csv file. The following works: import tablib dataset = tablib.Dataset().load(open('data.csv').read()) However, in some cases, I'd like to load the .csv file from a URL. Any ideas on…
apiljic
  • 527
  • 4
  • 14
1
vote
0 answers

result of response.json() causes " 'Response' object has no attribute 'read' " error

I am trying to convert json from an external api to an xls file using requests and tablib. In order to do this, I send a request to the external api, which returns a valid json file. This is my code: response = req.request("GET", url,…
budgiebeaks
  • 159
  • 9
1
vote
0 answers

Change page until last available PYTHON

I am writing a script to automate the extraction of a report via API, I came across a problem where the API limits the query to one page (x-page) at a time. How could I change this page to this last amount? And how to insert the new information…
1
vote
1 answer

Convert Json with sub fields to CSV in python

I have a file with sample JSON output looks as below: jsonoutput.txt file: [{"fruit": "orange", "id":1, "countries": ["Portugal"], "color": "Orange"} {"fruit": "apple", "id":2, "countries": ["Portugal"], "color": "red"}] I need the output csv as…
user2841047
  • 71
  • 2
  • 2
  • 8
0
votes
0 answers

django import excel file with multi sheets

hello everyone please I have a concern for using Django’s Tablib module to load an excel file that contains multiple sheets. I don’t know how to retrieve a specific sheet
0
votes
1 answer

How to preserve date format when export dataset to Excel file using tablib?

I've written a python script that creates a new Excel file from an existing one by copying some columns only. For this, I've used tablib library, but I'm facing an error with columns that have dates as values. In the original file the format is like…
Oussama He
  • 555
  • 1
  • 10
  • 31
0
votes
1 answer

Clean headers and remove bold text

I have a CSV that has bold text on all of the first columns. I wanted to sanitize it first since now it failed to get the row I wanted to get. I tried printing the row in before_import_row and this is how it looks like. ('\ufeffaccount_number',…
n0minal
  • 3,195
  • 9
  • 46
  • 71
0
votes
2 answers

Displaying CSV file as HTML page using Flask

I have a CSV file called random.csv which I want to render on a html page if the user is logged in. I've tried using tablib for this. __init__.py from flask import Flask import tablib app = Flask(__name__) dataset =…
CuriousLearner
  • 421
  • 4
  • 14
0
votes
1 answer

Tablib fails to convert JSON API response to XLSX file and throws error KeyError:0

I am trying to convert a JSON response I get after calling an API to an excel file. I don't need to add specific headers or get only specific data, I just need everything this call returns. I have found the tablib library. I managed to make it…
Marialena
  • 817
  • 8
  • 31
0
votes
1 answer

using tablib and django-import-export to import data, getting error with excel, but with csv it's working

At first trying to read excel/csv data to check it before inserting into database, While csv working fine can read data, but xlsx and xlx showing following error UnicodeDecodeError at /academy/add_advisor 'utf-8' codec can't decode byte 0xa1 in…
1
2