import shelve


def delete_item(key: str, dbname: str):
    """
    Delete item from db.
    False in case of an error (also non existing item) otherwise True
    """
    try:
        with shelve.open(dbname) as db:
            del db[key]
    except:
        return False
    return True