def generate_id(text):
    """Deterministically generates an ID from a given text.
    NOT guaranteed to be unique, but the alternative was to
    either drop some data for not having IDs, or 
    generating uniquely on the fly: which is hard to do on
    a batch system.
    
    A negative integer is returned to avoid conflicts 
    with the data which have ids already. 8 digits are
    returned, since 9 are the maximum allowed in the schema.

    Args:
        text (str): Text to convert to a negative 8-digit integer
    Returns:
        _id (int): A negative 8-digit integer.
    """
    # Start from the second digit to allow for 
    _id = str(int.from_bytes(text.encode(), 'big',
                             signed=False))
    end = 9 if len(_id) > 8 else None
    start = 1 if len(_id) > 8 else None
    return -int(_id[start:end])