diff --git a/kingfisher_scrapy/commands/checkall.py b/kingfisher_scrapy/commands/checkall.py index 6eb9b9bd..8f2bbecc 100644 --- a/kingfisher_scrapy/commands/checkall.py +++ b/kingfisher_scrapy/commands/checkall.py @@ -159,7 +159,7 @@ def check_date_spider_argument(self, spider_argument, spider_arguments, default, if spider_argument in spider_arguments: # These classes are known to have more specific semantics. if self.cls.__name__ in ('ColombiaBulk', 'PortugalRecords', 'PortugalReleases', - 'ScotlandPublicContracts'): + 'ScotlandPublicContracts', 'Uganda'): level = 'info' else: level = 'warning' diff --git a/kingfisher_scrapy/spiders/uganda_releases.py b/kingfisher_scrapy/spiders/uganda_releases.py index ba0cdbf9..8dc8aae8 100644 --- a/kingfisher_scrapy/spiders/uganda_releases.py +++ b/kingfisher_scrapy/spiders/uganda_releases.py @@ -10,22 +10,24 @@ class Uganda(IndexSpider): Government Procurement Portal (GPP) of Public Procurement and Disposal of Public Assets Authority (PPDA) Spider arguments from_date - Download only data from this year onward (YYYY format). Defaults to '2017'. + Download only data from this year onward (YYYY format). + If ``until_date`` is provided, defaults to '2017'. The year refers to the start of the fiscal year range, e.g. if from_date='2017' then fiscal_year='2017-2018' until_date - Download only data until this year (YYYY format). Defaults to the current year. + Download only data until this year (YYYY format). + If ``from_date`` is provided, defaults to the current year. The year refers to the start of the fiscal year range, e.g. if until_date='2017' then fiscal_year='2017-2018' API documentation https://docs.google.com/spreadsheets/d/10tVioy-VOQa1FwWoRl5e1pMbGpiymA0iycNcoDFkvks/edit#gid=365266172 """ name = 'uganda_releases' download_delay = 30 # to avoid API 429 error "too many request" - date_format = 'year' custom_settings = { 'CONCURRENT_REQUESTS': 1, } # BaseSpider + date_format = 'year' default_from_date = '2017' # SimpleSpider @@ -54,7 +56,7 @@ def parse_data(self, response): for plans in pdes['procurement_plans']: for tag in ('planning', 'tender', 'award', 'contract'): if self.from_date and self.until_date: - start_year = int(plans['financial_year'].split("-")[0]) + start_year = int(plans['financial_year'].split('-')[0]) if not (self.from_date.year <= start_year <= self.until_date.year): continue yield self.build_request(