458b90b35f519469a443af450f3b0dfc65aa97c1 — Humaid AlQassimi 8 days ago 13d059c master
Show first dose and last entry in template
2 files changed, 16 insertions(+), 9 deletions(-)

M main.py
M template.html
M main.py => main.py +8 -1
@@ 23,6 23,11 @@ for index, row in owid.iterrows():
    if not math.isnan(fully):
        dat.append([row['date'], (fully/UAE_POP)*100])

last_entry = dat[len(dat)-1][0]

first_dose = (owid.tail(1)['people_vaccinated'].item()/UAE_POP)*100
first_dose = round(first_dose, 2)
dataset = pd.DataFrame(dat, columns=['Date', 'Percentage'])
dataset['Date'] = pd.to_datetime(dataset['Date'])

@@ 47,7 52,9 @@ def gen_html(estimate):
         'goalMs': round(estimate.timestamp()),
         'today': date.today().strftime("%d %B"),
         'ver': round(datetime.now().timestamp()),
         'goal': int(GOAL)},
         'goal': int(GOAL),
         'lastEntry': datetime.strptime(last_entry, "%Y-%m-%d").strftime("%d %B"),
         'vaccinated': first_dose},
    f = open("index.html", "w")

M template.html => template.html +8 -8
@@ 52,7 52,7 @@ img {
  <p><small>The goal of @goal% of the people fully vaccinated is based on the
    estimated R0 rate of the delta variant. Estimates show the R0 of the delta
    variant is between 4-9, we assume an R0 of 6.5.</small></p>
    variant is between 4-9<sup>[1]</sup>, we assume an R0 of 6.5.</small></p>

  <p><small>This estimate is predicted using polynomial regression, expect it
    to change frequently. Remember, this is <b>just an estimation</b> on an

@@ 61,14 61,14 @@ img {
  <p><small>This is a hobbyist website, which is
    unaffiliated with any authority or official body.</small></p>

  <p><small>Data source: <a href="https://github.com/owid/covid-19-data">
    Our World in Data</a></small></p>
  <p><small>[1]: <a
      Is The Variant From India The Most Contagious Coronavirus Mutant On The
      Planet?: NPR</a></small></p>
  <p><small>[1]: <a href="https://unchartedterritories.tomaspueyo.com/p/delta-variant-everything-you-need">
      Delta Variant: Everything You Need to Know</a></small></p>

  <p><small>Last updated: @today</small></p>
  <p><small>Page generated: @today &middot; Latest entry: @lastEntry &middot;
    Data source: <a href="https://github.com/owid/covid-19-data">
    Our World in Data</a></small></p>
  <p><small>@vaccinated% of the people received at least the first dose. The
    goal is @goal%.</small></p>
  <p><small><a href="https://git.sr.ht/~humaid/areweherdimmuneyet"
               target="src">Website Source Code</a> (released under BSD