Exemple #1
0
def companies_countriesData(period, startdate, enddate, identities_db, destdir):
    companies = SCM.companies_name(startdate, enddate)
    companies = companies['name']
    for company in companies:
        company_name = "'"+company+ "'"
        countries  = SCM.scm_countries_names(identities_db,startdate, enddate)
        countries = countries['name']
        for country in countries :
            print (country, "=>", company)
            data = SCM.scm_companies_countries_evol(identities_db, company, country, nperiod, startdate, enddate)
            data = completePeriodIds(data)
            createJSON (data, destdir + "/"+company+"_"+country+"-scm-evolutionary.json", False)
Exemple #2
0
def countriesData(period, startdate, enddate, identities_db, destdir):
    countries  = SCM.scm_countries_names(identities_db,startdate, enddate)
    countries = countries['name']
    createJSON(countries, destdir+"/scm-countries.json")

    for country in countries:
        print (country)
        country_name = "'"+country+"'"

        evol_data = SCM.GetSCMEvolutionaryData(period, startdate, enddate, identities_db, ["country", country_name])
        evol_data = completePeriodIds(evol_data)
        createJSON (evol_data, destdir+"/"+country+"-scm-cou-evolutionary.json")

        agg = SCM.GetSCMStaticData(period, startdate, enddate, identities_db, ["country", country_name])
        createJSON (agg, destdir+"/"+country+"-scm-cou-static.json")