Exemplo n.º 1
0
def upload_file(filename,
                server,
                account,
                projname,
                reader_dict=None,
                username=None,
                password=None,
                append=False,
                stage=False):
    """
    Upload a file to Luminoso with the given account and project name.

    Given a file containing JSON, JSON stream, or CSV data, this verifies
    that we can successfully convert it to a JSON stream, then uploads that
    JSON stream.
    """
    if reader_dict is None:
        reader_dict = {}
    stream = transcode_to_stream(filename)
    upload_stream(stream_json_lines(stream),
                  server,
                  account,
                  projname,
                  reader_dict,
                  username=username,
                  password=password,
                  append=append,
                  stage=stage)
Exemplo n.º 2
0
def upload_file(filename, server, account, projname, reader_dict):
    """
    Upload a file to Luminoso with the given account and project name.

    Given a file containing JSON, JSON stream, or CSV data, this verifies
    that we can successfully convert it to a JSON stream, then uploads that
    JSON stream.
    """
    stream = transcode_to_stream(filename)
    upload_stream(stream_json_lines(stream),
        server, account, projname, reader_dict)
def upload_file(filename, server, account, projname, language=None,
                username=None, password=None,
                append=False, stage=False, date_format=None):
    """
    Upload a file to Luminoso with the given account and project name.

    Given a file containing JSON, JSON stream, or CSV data, this verifies
    that we can successfully convert it to a JSON stream, then uploads that
    JSON stream.
    """
    stream = transcode_to_stream(filename, date_format)
    upload_stream(stream_json_lines(stream),
                  server, account, projname, language=language,
                  username=username, password=password,
                  append=append, stage=stage)