Skip to content

Commit

Permalink
Added TDoR 2024 downloads and TGEU source data.
Browse files Browse the repository at this point in the history
Also cropped the TDoR 2023 victim collage to remove excess whitespace
  • Loading branch information
annajayne committed Nov 20, 2024
1 parent bf8dee0 commit d090f7a
Show file tree
Hide file tree
Showing 13 changed files with 6,766 additions and 39 deletions.
1 change: 1 addition & 0 deletions .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ Projects/TDoR/tests/output/*.*
Projects/TDoR/vendor*

Projects/TdorListToCsv/__pycache__/*
Projects/TdorListToCsv/data/*_processed.csv
Binary file modified Projects/TDoR/src/downloads/tdor_2023_victims.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Projects/TDoR/src/downloads/tdor_2024_map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Projects/TDoR/src/downloads/tdor_2024_slides.pptx
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Projects/TDoR/src/downloads/tdor_2024_victims.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Projects/TDoR/src/util/geocode.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function get_country_codes()
'Congo, Democratic Republic' => 'CD',
'Cook Islands' => 'CK',
'Costa Rica' => 'CR',
'Cote D\'Ivoire' => 'CI',
'Côte d\'Ivoire' => 'CI',
'Croatia' => 'HR',
'Cuba' => 'CU',
'Cyprus' => 'CY',
Expand Down
55 changes: 49 additions & 6 deletions Projects/TDoR/src/views/pages/downloads.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,51 @@
echo "<h2>Downloads and Resources</h2>";
echo '<p>&nbsp;</p>';

// TDoR 2024
echo '<p>&nbsp;</p>';
echo '<div class="row">';
echo '<div class="grid_3">';
echo '<img src="/downloads/tdor_2023_list_thumbnail.png" />';
echo '<a href="/reports/tdor2024?country=all&filter=&sortup=1&view=list" target="_blank"><img src="/downloads/tdor_2024_list_thumbnail.png" /></a>';
echo '</div>';
echo '<div class="grid_9">';
echo '<p>TDoR 2024 list of names [<a href="/reports/tdor2024?country=all&filter=&sortup=1&view=list" target="_blank">View</a>]<br>(tip: print to PDF and download)</p>';
echo '</div>';
echo '</div>';

echo '<div class="row">';
echo '<div class="grid_3">';
echo '<a href="/downloads/tdor_2024_victims.png" rel="lightbox" title="Just some of the trans people we have lost during the TDoR 2024 period"><img src="/downloads/tdor_2024_victims.png" /></a>';
echo '</div>';
echo '<div class="grid_9">';
echo '<p>TDoR 2024 victim photo collage [<a href="/downloads/tdor_2024_victims.png" download="tdor_2024_victims">Download</a>]</p>';
echo '</div>';
echo '</div>';

echo '<div class="row">';
echo '<div class="grid_3">';
echo '<a href="/downloads/tdor_2024_map.png" rel="lightbox" title="Map showing the locations where trans people are known to have passed awayduring the TDoR 2024 period"><img src="/downloads/tdor_2024_map.png" /></a>';
echo '</div>';
echo '<div class="grid_9">';
echo '<p>TDoR 2024 map of cases [<a href="/downloads/tdor_2024_map.png" download="tdor_2024_map">Download</a>]</p>';
echo '</div>';
echo '</div>';

echo '<div class="row">';
echo '<div class="grid_3">';
echo '<a href="/downloads/tdor_2024_slides_thumbnail.png" rel="lightbox" title="A preview of the first page of the slides. Feel free to <a href=\'/reports/tdor2024?country=all&filter=&action=presentation&sortup=1\'>download</a> and edit them as needed"><img src="/downloads/tdor_2024_slides_thumbnail.png" /></a>';
echo '</div>';
echo '<div class="grid_9">';
echo '<p>TDoR 2024 Powerpoint slides [<a href="/downloads/tdor_2024_slides.pptx" download="tdor_2024_slides">Download</a>]</p>';
echo '</div>';
echo '</div>';

echo '<p>&nbsp;</p>';

// TDoR 2023
echo '<p>&nbsp;</p>';
echo '<div class="row">';
echo '<div class="grid_3">';
echo '<a href="/reports/tdor2023?country=all&filter=&sortup=1&view=list" target="_blank"><img src="/downloads/tdor_2023_list_thumbnail.png" /></a>';
echo '</div>';
echo '<div class="grid_9">';
echo '<p>TDoR 2023 list of names [<a href="/reports/tdor2023?country=all&filter=&sortup=1&view=list" target="_blank">View</a>]<br>(tip: print to PDF and download)</p>';
Expand All @@ -28,7 +69,7 @@

echo '<div class="row">';
echo '<div class="grid_3">';
echo '<a href="/downloads/tdor_2023_map.png" rel="lightbox" title="Map showing the locations where trans people died during the TDoR 2023 period"><img src="/downloads/tdor_2023_map.png" /></a>';
echo '<a href="/downloads/tdor_2023_map.png" rel="lightbox" title="Map showing the locations where trans people are known to have passed awayduring the TDoR 2023 period"><img src="/downloads/tdor_2023_map.png" /></a>';
echo '</div>';
echo '<div class="grid_9">';
echo '<p>TDoR 2023 map of cases [<a href="/downloads/tdor_2023_map.png" download="tdor_2023_map">Download</a>]</p>';
Expand All @@ -45,10 +86,11 @@

echo '<p>&nbsp;</p>';

// TDoR 2022
echo '<p>&nbsp;</p>';
echo '<div class="row">';
echo '<div class="grid_3">';
echo '<img src="/downloads/tdor_2022_list_thumbnail.png" />';
echo '<a href="/reports/tdor2022?country=all&filter=&sortup=1&view=list" target="_blank"><img src="/downloads/tdor_2022_list_thumbnail.png" /></a>';
echo '</div>';
echo '<div class="grid_9">';
echo '<p>TDoR 2022 list of names [<a href="/reports/tdor2022?country=all&filter=&sortup=1&view=list" target="_blank">View</a>]<br>(tip: print to PDF and download)</p>';
Expand All @@ -66,7 +108,7 @@

echo '<div class="row">';
echo '<div class="grid_3">';
echo '<a href="/downloads/tdor_2022_map.png" rel="lightbox" title="Map showing the locations where trans people died during the TDoR 2022 period"><img src="/downloads/tdor_2022_map.png" /></a>';
echo '<a href="/downloads/tdor_2022_map.png" rel="lightbox" title="Map showing the locations where trans people are known to have passed awayduring the TDoR 2022 period"><img src="/downloads/tdor_2022_map.png" /></a>';
echo '</div>';
echo '<div class="grid_9">';
echo '<p>TDoR 2022 map of cases [<a href="/downloads/tdor_2022_map.png" download="tdor_2022_map">Download</a>]</p>';
Expand All @@ -83,10 +125,11 @@

echo '<p>&nbsp;</p>';

// TDoR 2021
echo '<p>&nbsp;</p>';
echo '<div class="row">';
echo '<div class="grid_3">';
echo '<img src="/downloads/tdor_2021_list_thumbnail.png" />';
echo '<a href="/reports/tdor2021?country=all&filter=&sortup=1&view=list" target="_blank"><img src="/downloads/tdor_2021_list_thumbnail.png" /></a>';
echo '</div>';
echo '<div class="grid_9">';
echo '<p>TDoR 2021 list of names [<a href="/reports/tdor2021?country=all&filter=&sortup=1&view=list"" target="_blank">View</a>]<br>(tip: print to PDF and download)</p>';
Expand All @@ -104,7 +147,7 @@

echo '<div class="row">';
echo '<div class="grid_3">';
echo '<a href="/downloads/tdor_2021_map.png" rel="lightbox" title="Map showing the locations where trans people died during the TDoR 2021 period"><img src="/downloads/tdor_2021_map.png" /></a>';
echo '<a href="/downloads/tdor_2021_map.png" rel="lightbox" title="Map showing the locations where trans people are known to have passed awayduring the TDoR 2021 period"><img src="/downloads/tdor_2021_map.png" /></a>';
echo '</div>';
echo '<div class="grid_9">';
echo '<p>TDoR 2021 map of cases [<a href="/downloads/tdor_2021_map.png" download="tdor_2021_map">Download</a>]</p>';
Expand Down
108 changes: 78 additions & 30 deletions Projects/TdorListToCsv/ReadTgeuCsvFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,52 +41,100 @@ def read(self, pathname):

csv_reader = csv.reader(f, delimiter=',', quotechar='"')

# Default fields:

# TDoR 2021-23:
#
# Name - row[0]
# Age - row[1]
# Occupation - row[2] (not currently used)
# Date of death - row[3]
# City - row[4]
# Country - row[5]
# Location of death - row[6] (not currently used)
# Cause of death - row[7]
# Remarks - row[8] Maps to "Description"
# Observaciones - row[9] (not currently used)
# Sources - row[10] Appended to remarks
# Reported by - row[11] Appended to remarks

name_field = 0
age_field = 1
date_field = 3
city_field = 4
country_field = 5
cause_field = 7
remarks_field = 8
sources_field = 10
reported_by_field = 11

for row in csv_reader:
print(', '.join(row))

# Fields:

# Name - row[0]
# Age - row[1]
# Occupation - row[2] (not currently used)
# Date of death - row[3]
# City - row[4]
# Country - row[5]
# Location of death - row[6] (not currently used)
# Cause of death - row[7]
# Remarks - row[8] Maps to "Description"
# Observaciones - row[9] (not currently used)
# Sources - row[10] Appended to remarks
# Reported by - row[11] Appended to remarks

if (not row[0].startswith('\ufeff')) and (row[0] != 'Name'): # Skip the header
is_header = (row[0].startswith('\ufeff')) or (row[0] == 'Name') or (row[1] == 'Name')

if (is_header):
if (row[1] == 'Name'):
# TDoR 2024:
#
# (no title) - row[0] (not currently used)
# Name - row[1]
# Age - row[2]
# Occupation - row[3] (not currently used)
# Date of death - row[4]
# City - row[5]
# Country - row[6]
# Location of death - row[7] (not currently used)
# Cause of death - row[8]
# Remarks - row[9] Maps to "Description"
# Observaciones - row[10] (not currently used)
# Reported by - row[11] Appended to remarks
# Sources - row[12] Appended to remarks

name_field = 1
age_field = 2
date_field = 4
city_field = 5
country_field = 6
cause_field = 8
remarks_field = 9
reported_by_field = 11
sources_field = 12
else:
name = row[name_field].rstrip()
if (name == ''):
continue

report = Report()
reports.append(report)

name = row[0]
if (name == 'N.N.'):
if (name == 'N.N.') or (name == 'N. N.'):
name = 'Name Unknown'
report.set_name(name)

if (row[1] != 'not reported'):
report.set_age(row[1])
age = row[age_field]
if (age != 'not reported') and (age != 'unknown'):
report.set_age(age)

date_value = self.parse_date(row[3])
date_value = self.parse_date(row[date_field])
report.set_date(date_value)

location = ''
if (row[4] != ''):
location = row[4] + ' (' + row[5] + ')'
city = row[city_field]
country = row[country_field]

if (city != ''):
location = city + ' (' + country + ')'
else:
location = row[4]
location = country

report.set_location(location)
#report.set_city(row[4])
#report.set_country(row[5])
report.set_cause(row[7])
report.set_remarks(row[8])
report.set_source(row[10])
report.set_reported_by(row[11])
#report.set_city(city)
#report.set_country(country)
report.set_cause(row[cause_field])
report.set_remarks(row[remarks_field])
report.set_source(row[sources_field])
report.set_reported_by(row[reported_by_field])

f.close()

Expand Down
35 changes: 33 additions & 2 deletions Projects/TdorListToCsv/TdorListToCsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def setUp(self):
def test_count(self):
count = len(self.reports)

self.assertEqual(count, 375)
self.assertEqual(count, 374)


class Test_read_tdor_2022(unittest.TestCase):
Expand All @@ -400,6 +400,37 @@ def test_count(self):
self.assertEqual(count, 327)


class Test_read_tdor_2023(unittest.TestCase):
def setUp(self):
folder = os.path.dirname(os.path.realpath(__file__) )

self.txt_file_pathname = folder + "/data/TvT_TMM_TDoR2023_Namelist.csv"

reader = TgeuCsvFileReader()
self.reports = reader.read(self.txt_file_pathname);


def test_count(self):
count = len(self.reports)

self.assertEqual(count, 320)


class Test_read_tdor_2024(unittest.TestCase):
def setUp(self):
folder = os.path.dirname(os.path.realpath(__file__) )

self.txt_file_pathname = folder + "/data/TGEU-TMM-TDoR2024-Namelist.csv"

reader = TgeuCsvFileReader()
self.reports = reader.read(self.txt_file_pathname);


def test_count(self):
count = len(self.reports)

self.assertEqual(count, 350)



class Test_ReportsCsvWriter(unittest.TestCase):
Expand Down Expand Up @@ -515,7 +546,7 @@ def write_csv_file_from_tgeu_csv_file(input_file_pathname, output_file_pathname)
write_csv_file_from_tgeu_txt_file(txt_file_pathname, csv_file_pathname)


# For TDoR 2021 and 2022 both the input and output files are CSV files
# For TDoR 2021 onwards both the input and output files are CSV files
input_file_pathnames = glob.glob(folder + '/*Namelist.csv')

for input_file_pathname in input_file_pathnames:
Expand Down
Loading

0 comments on commit d090f7a

Please sign in to comment.