@classmethod
def from_raw(cls, buf):
    """Create a new :py:class:`Index` object from an existing APKINDEX.

        :param buf:
            The buffer to read from (whether file, BytesIO, etc).

        :returns:
            A :py:class:`Index` object with the details from the APKINDEX.
        """
    idx = cls(packages=list())
    idx._fill_from_index_file(buf)
    return idx
