From 87cc4b64470d5239abedc915280685186f421af0 Mon Sep 17 00:00:00 2001 From: Mark Brough Date: Fri, 19 May 2017 16:39:09 +0000 Subject: [PATCH] Add leading zero --- scraper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scraper.py b/scraper.py index 30f0641..94d91e5 100644 --- a/scraper.py +++ b/scraper.py @@ -19,9 +19,12 @@ def get_page(): def clean_fy(value): value = value.strip() - if value == "calendar year": return "1 January" + if value == "calendar year": return "01 January" if value == "NA": return "Unknown" fy_start, fy_end = value.split("-") + day, month = fy_start.split(" ") + if len(day)==1: + return "0{} {}".format(day, month) return fy_start def init_git_repo():