add ability to parse from a file object