https://github.com/nexB/typecode/blob/main/src/typecode/contenttype.py#L732 for example this can be provided as a bare function which can take file as an input directly