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

Comments

Projects
None yet
2 participants
@lvieirajr

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

This comment has been minimized.

Show comment
Hide comment
@turicas

turicas Nov 15, 2015

Owner

Related to #129.

Owner

turicas commented Nov 15, 2015

Related to #129.

@turicas

This comment has been minimized.

Show comment
Hide comment
@turicas

turicas Feb 2, 2016

Owner

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.

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

This comment has been minimized.

Show comment
Hide comment
@turicas

turicas Feb 2, 2016

Owner

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)
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