Dot memorial

a personal memorial for lives lost due to covid-19
, ,

mport csv, json, urllib.request, datetime
from codecs import iterdecode
def main(latest):
    url =   'https://raw.githubusercontent.com/CSSEGISandData/COVID-19/'   
+'master/csse_covid_19_data/csse_covid_19_daily_reports/'
            +latest+'.csv'
    try:
        latest = urllib.request.urlopen(url)
        return generatejson(latest)
    except urllib.request.HTTPError:
        print('url not found')
        return False
def generatejson(csvfile):
    data = {}
    total = 0
    csvReader = csv.DictReader(iterdecode(csvfile, 'utf-8'))
    for row in csvReader:
        name = row['Country_Region']
        Deaths = int(row['Deaths'])    
        if name not in data:
            data[name] = Deaths
        else:
            data[name] += Deaths
        total += Deaths
    data = {k: v for k, v in sorted(data.items(), key=lambda item: item[1],reverse=True)}
    with open('data.json', 'w') as jsonfile:
        jsonfile.write(json.dumps(data))
    return total
Framing Leaders

Algorithmically generated framed pictures of heads of governments
, , ,

#!/usr/bin/python
#
import datetime
for row in cursor.fetchall():
  if row['country_code'] + ".png" in srcfiles:
    x = datetime.datetime.now().date() - row['h_gov_since']
    if x.days > 365*2:
      years = " ("+ str(math.floor(x.days/365))[:-2] + " years)"
    elif x.days < 365:
      years = " ("+ str(x.days) + " days)"
      
    else:
      years = " ("+ str(math.floor(x.days/365))[:-2] + " year)" 
    img = row['country_code'] + ".png"
    imgs.append(img)
    li[img] = row['country_name'].capitalize() + years
    height.append(Image.open(pathx + img).size[1]+35)
    width.append(Image.open(pathx + img).size[0]+20)
Flags By Colours

Data visualization experiment using flags of the world
, , , ,

#!/usr/bin/python
#
from sys import argv
import Image, ImageDraw 
im = Image.open(argv[1]) 
im = im.convert('RGB') 
colors = {}; total = 0
for y in range(im.size[1]):
  for x in range(im.size[0]):
    color = im.getpixel((x,y))
    if color in colors.keys():
      colors[color] += 1
    else:
      colors[color] = 1
    total += 1 
Generator

An evolving algorithm that generates music & visuals
, ,

#!/usr/bin/python
from common import *
import random


while 1:
  num = 000
  files = ls (images, 'jpg')
  last = len(files)
  half = str(round (last/2))
  half = int(half[:half.find('.')])-3
  using = files[last-10:last]
  using.sort()
  using.reverse()
  using += files[half:half+10]
Blindscapes

Photographing urban life in Malé
, ,

    __      __    _                __                                      
   / /_    / /   (_)   ____   ____/ /   _____  _____  ____ _    ____   ___ 
  / __ \  / /   / /   / __ \ / __  /   / ___/ / ___/ / __ `/   / __ \ / _ \
 / /_/ / / /   / /   / / / // /_/ /   (__  ) / /__  / /_/ /   / /_/ //  __/
/_.___/ /_/   /_/   /_/ /_/ \__,_/   /____/  \___/  \__,_/   / .___/ \___/ 
                                                            /_/            
        
   _____
  / ___/
 (__  ) 
/____/  
        
Malé Aerial

Aerial photography of the island city of Malé
,

                        __      
   ____ ___   ____ _   / /  ___ 
  / __ `__ \ / __ `/  / /  / _ \
 / / / / / // /_/ /  / /  /  __/
/_/ /_/ /_/ \__,_/  /_/   \___/ 
                                
                          _             __
  ____ _  ___    _____   (_)  ____ _   / /
 / __ `/ / _ \  / ___/  / /  / __ `/  / / 
/ /_/ / /  __/ / /     / /  / /_/ /  / /  
\__,_/  \___/ /_/     /_/   \__,_/  /_/