예제 #1
0
        'country': 'Korea', # this will be stored as 'kr'
        'companyName': row['company_name'].decode('utf8', errors='ignore'),
        'state': row['state'].decode('utf8', errors='ignore')
    })
    company.url = row['url'].decode('utf8', errors='ignore')
    company.yearFounded = row['year_founded'].decode('utf8', errors='ignore')
    company.city = row['city'].decode('utf8', errors='ignore')
    company.zipCode = row['zip_code'].decode('utf8', errors='ignore').zfill(5) 
    company.companyCategory = row['company_category'].decode('utf8', errors='ignore')
    company.companyType = row['company_type'].decode('utf8', errors='ignore')
    company.fte = row['full_time_employees'].decode('utf8', errors='ignore')
    company.revenueSource = row['revenue_source'].decode('utf8', errors='ignore').split(', ')
    company.businessModels = row['business_model'].decode('utf8', errors='ignore')
    company.socialImpact = row['social_impact'].decode('utf8', errors='ignore').split(', ')
    company.description = row['description'].decode('utf8', errors='ignore')
    company.prettyName = Tools.prettify(company['companyName'])
    company.filters = []

    if company.companyType.lower() == 'nonprofit':
        company.companyType = 'Non-profit'

    if company.fte == '10-Jan':
        company.fte = '1 - 10'
    elif company.fte == 'Nov-50':
        company.fte = '11 - 50'

    company.companyCategory = company.companyCategory.split(',')[0]

    agency_names = row['agencies'].decode('utf8', errors='ignore').split(', ')
    agencies = []
    for agency_name in agency_names:
예제 #2
0
    company.url = row['url'].decode('utf8', errors='ignore')
    company.yearFounded = row['year_founded'].decode('utf8', errors='ignore')
    company.city = row['city'].decode('utf8', errors='ignore')
    company.zipCode = row['zip_code'].decode('utf8', errors='ignore').zfill(5)
    company.companyCategory = row['company_category'].decode('utf8',
                                                             errors='ignore')
    company.companyType = row['company_type'].decode('utf8', errors='ignore')
    company.fte = row['full_time_employees'].decode('utf8', errors='ignore')
    company.revenueSource = row['revenue_source'].decode(
        'utf8', errors='ignore').split(', ')
    company.businessModels = row['business_model'].decode('utf8',
                                                          errors='ignore')
    company.socialImpact = row['social_impact'].decode(
        'utf8', errors='ignore').split(', ')
    company.description = row['description'].decode('utf8', errors='ignore')
    company.prettyName = Tools.prettify(company['companyName'])
    company.filters = []

    if company.companyType.lower() == 'nonprofit':
        company.companyType = 'Non-profit'

    if company.fte == '10-Jan':
        company.fte = '1 - 10'
    elif company.fte == 'Nov-50':
        company.fte = '11 - 50'

    company.companyCategory = company.companyCategory.split(',')[0]

    agency_names = row['agencies'].decode('utf8', errors='ignore').split(', ')
    agencies = []
    for agency_name in agency_names: