File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77from ravenpackapi import RPApi
88from ravenpackapi .util import parse_csv_line
99
10+ PRODUCT = "rpa" # Or PRODUCT="edge"
11+
12+ if PRODUCT == "rpa" :
13+ # Flat type for RPA:
14+ FLAT_TYPE = "companies" # One of "companies", "full"
15+ # FLAT_TYPE = "full"
16+ else :
17+ # Flat type for EDGE:
18+ FLAT_TYPE = "ESS_POSITIVE" # One of the many edge flatfiles
19+
1020
1121def main ():
12- api_key = os .environ ["RP_API_KEY" ] # set your API KEY here
13- api = RPApi (api_key )
22+ api = RPApi (product = PRODUCT )
1423
15- flat_type = "companies" # can be 'companies' or 'full'
16- flat_list = api .get_flatfile_list (flat_type )
24+ flat_list = api .get_flatfile_list (FLAT_TYPE )
1725
1826 for flat_file in flat_list :
1927 file_id = flat_file ["id" ]
2028 combined_year_filename = "%s.combined.csv" % file_id
2129 if os .path .isfile (combined_year_filename ):
2230 continue
23- download_flatfile (api , flat_type , flat_file )
31+ download_flatfile (api , FLAT_TYPE , flat_file )
2432 unzip_to_csv (file_id , combined_year_filename )
2533
2634
You can’t perform that action at this time.
0 commit comments