automatic file type detection

@handlesimon can you write a function that detects the file type from a string and applies the correct reader and include that in the main.py file?