Comments (6)
Probably a bug/limitation in the libmagic library. But if you drop the period from the extension argument (i.e. extension="xls") it should fall back to using that and hopefully will work.
from messytables.
Should be fixed in b63480e
If you don't provide an extension:
ValueError: Unrecognized MIME type: application/CDFV2-corrupt
If you provide .xls
(which should really be xls
):
ValueError: Could not determine MIME type and unrecognized extension: .xls
If you provide a correct extension xls
:
<messytables.excel.XLSTableSet object at 0x10e97d250>
from messytables.
Refiled over at scraperwiki#1, as I want to have a closer look to make it simpler.
from messytables.
If you use any_tableset with a CDF file, no mimetype and no extension with the code in b63480e for me it returns application/CDFV2-corrupt, but if I use magic.fromfile(fileobj.name) I get application/vnd.ms-excel
Presumably there is data later in the file that definitively identifies it as application/vnd.ms-excel (as CDF could be any office file type).
from messytables.
Messytables only looks at the first 1k, I believe [citation needed] that magic checks the first 4k.
There's a fix for this in my pull request; not sure whether this fixes that explicit example.
from messytables.
Nope. It requires at least 64K (of a 95K file)
Tested with:
dd if=Food_price_indices_data_deflated.xls bs=1 count=65536 of=Food_64K.xls
and similar.
(There's a specific C module in the file libary for CDF files.)
from messytables.
Related Issues (20)
- Add a sampling rate to the rowsets
- TypeError("object of type 'float' has no len()",) when calling type_guess HOT 10
- detect ods types: boolean, currency, time and percentage. support repeated column and multi-line text in a cell. HOT 1
- from six import viewkeys: cannot import name viewkeys
- Application for maintainership HOT 10
- type guessing a column of zeros (0) fails with exception
- Two fixes in reading ods format: duration correction and multi-text inside a paragraph
- Add support for Flat XML ODF Spreadsheet (.fods)
- Cell starting with a space in ods file is not parsed correctly
- Pass instantiated types to type_guess
- Potential dependency conflicts between messytables and chardet HOT 1
- Please add LICENSE
- requirements-test.txt should have xlrd==1.2.0 (or >=) for Python 3.8+ tests
- test_attempt_read_encrypted_no_password_xls failure in Python 3.7+
- messytables guesses wrong type for decimal number HOT 1
- Failure to load with Python 3.10
- headers_make_unique output not always unique
- messytables==0.15.2 is broken for python3.10 HOT 4
- Specifying true_values and false_values for Booltype
- Error in documentation example
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from messytables.