-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_sanctioned_data.py
More file actions
44 lines (35 loc) · 1.04 KB
/
Copy pathget_sanctioned_data.py
File metadata and controls
44 lines (35 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import urllib2
import time
date=time.strftime("%Y_%b_%d")
#UN Sanctioned List
url = 'https://scsanctions.un.org/resources/xml/en/consolidated.xml'
s=urllib2.urlopen(url)
contents=s.read()
fname="../data/sanctioned_un_"+date+"_.xml"
file=open(fname,'w')
file.write(contents)
file.close()
#US Sanctioned Consolidated List
url='https://www.treasury.gov/ofac/downloads/consolidated/consolidated.xml'
s=urllib2.urlopen(url)
contents=s.read()
fname="../data/sanctioned_consolidated_us_"+date+"_.xml"
file=open(fname,'w')
file.write(contents)
file.close()
#US SDN List
url='https://www.treasury.gov/ofac/downloads/sdn.xml'
s=urllib2.urlopen(url)
contents=s.read()
fname="../data/sanctioned_sdn_us_"+date+"_.xml"
file=open(fname,'w')
file.write(contents)
file.close()
#EU Sanctioned List
url='http://ec.europa.eu/external_relations/cfsp/sanctions/list/version4/global/global.xml'
s=urllib2.urlopen(url)
contents=s.read()
fname="../data/sanctioned_eu_"+date+"_.xml"
file=open(fname,'w')
file.write(contents)
file.close()