kifield/kifield.py
def extract_part_fields_from_csv(
    filename, inc_field_names=None, exc_field_names=None, recurse=False
):
    """Return a dictionary of part fields extracted from a CSV spreadsheet."""

    logger.log(
        DEBUG_OVERVIEW,
        "Extracting fields {}, -{} from CSV file {}.".format(
            inc_field_names, exc_field_names, filename
        ),
    )

    try:
        # Convert the CSV file into an XLSX workbook object and extract fields from that.
        wb, _ = csvfile_to_wb(filename)
        return extract_part_fields_from_wb(wb, inc_field_names, exc_field_names)
    except FieldExtractionError:
        logger.warn("Field extraction failed on {}.".format(filename))
    return {}
Return a dictionary of part fields extracted from a CSV spreadsheet.
Return a dictionary of part fields extracted from a CSV spreadsheet.
Return a dictionary of part fields extracted from a CSV spreadsheet .
def extract_part_fields_from_csv(
    filename, inc_field_names=None, exc_field_names=None, recurse=False
):
    logger.log(
        DEBUG_OVERVIEW,
        "Extracting fields {}, -{} from CSV file {}.".format(
            inc_field_names, exc_field_names, filename
        ),
    )
    try:
        wb, _ = csvfile_to_wb(filename)
        return extract_part_fields_from_wb(wb, inc_field_names, exc_field_names)
    except FieldExtractionError:
        logger.warn("Field extraction failed on {}.".format(filename))
    return {}
def extract_part_fields_from_csv ( filename , inc_field_names = None , exc_field_names = None , recurse = False ) : logger . log ( DEBUG_OVERVIEW , "Extracting fields {}, -{} from CSV file {}." . format ( inc_field_names , exc_field_names , filename ) , ) try : wb , _ = csvfile_to_wb ( filename ) return extract_part_fields_from_wb ( wb , inc_field_names , exc_field_names ) except FieldExtractionError : logger . warn ( "Field extraction failed on {}." . format ( filename ) ) return { }
Return a dictionary of part fields extracted from a CSV spreadsheet.
Return a dictionary of part fields extracted from a CSV spreadsheet .
"""Return a dictionary of part fields extracted from a CSV spreadsheet.""" # Convert the CSV file into an XLSX workbook object and extract fields from that.
filename
inc_field_names
exc_field_names
recurse