Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve import_from_uri to discover the mimetype of the file #143

Open
lvieirajr opened this issue Nov 15, 2015 · 3 comments
Open

Improve import_from_uri to discover the mimetype of the file #143

lvieirajr opened this issue Nov 15, 2015 · 3 comments

Comments

@lvieirajr
Copy link

Currently import_from_uri only resolves which plugin it will use based on the file extension, something that can be easily changed to mask the real type of the file.

It would be a nice addition to rows if import_from_uri could recognize the mimetype of the file, instead of looking at the extension.

Some useful packages that could be used:

@turicas
Copy link
Owner

turicas commented Nov 15, 2015

Related to #129.

@turicas
Copy link
Owner

turicas commented Feb 2, 2016

Update on it (after some months...): I just uploaded the official version of file wrapper to the PyPI. We can install it by running:

pip install file-magic

And we can use to either detect the encoding or the file type, which could be used to solve this issue and also #129.

I've also written a blog post about file-magic library usage.

@turicas
Copy link
Owner

turicas commented Feb 2, 2016

Note: the reasons to use file-magic instead of filemagic and python-magic are:

  • We can install file-magic using both pip (pip install file-magic) and apt-get (apt-get install python-magic) so we won't have problems packaging rows to Debian (@kretcheu, look at this! Will change the dependencies on new version)
  • It's the official implementation (maintained by file maintainers)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants