Skip to content

Commit

Permalink
chore: Rename files for CKAN API responses
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Sep 19, 2023
1 parent 08761b6 commit 49528bf
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion kingfisher_scrapy/spiders/argentina_buenos_aires.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ArgentinaBuenosAires(SimpleSpider):
def start_requests(self):
# A CKAN API JSON response.
url = 'https://data.buenosaires.gob.ar/api/3/action/package_show?id=buenos-aires-compras'
yield scrapy.Request(url, meta={'file_name': 'list.json'}, callback=self.parse_list)
yield scrapy.Request(url, meta={'file_name': 'package_show.json'}, callback=self.parse_list)

@handle_http_error
def parse_list(self, response):
Expand Down
2 changes: 1 addition & 1 deletion kingfisher_scrapy/spiders/bolivia_agetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class BoliviaAgetic(SimpleSpider):
def start_requests(self):
# A CKAN API JSON response.
url = 'https://datos.gob.bo/api/3/action/package_show?id=contrataciones-agetic-2019-estandar-ocp'
yield scrapy.Request(url, meta={'file_name': 'list.json'}, callback=self.parse_list)
yield scrapy.Request(url, meta={'file_name': 'package_show.json'}, callback=self.parse_list)

@handle_http_error
def parse_list(self, response):
Expand Down
2 changes: 1 addition & 1 deletion kingfisher_scrapy/spiders/canada_quebec.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CanadaQuebec(SimpleSpider):
def start_requests(self):
# A CKAN API JSON response.
url = 'https://www.donneesquebec.ca/api/3/action/package_show?id=d23b2e02-085d-43e5-9e6e-e1d558ebfdd5'
yield scrapy.Request(url, meta={'file_name': 'list.json'}, callback=self.parse_list)
yield scrapy.Request(url, meta={'file_name': 'package_show.json'}, callback=self.parse_list)

@handle_http_error
def parse_list(self, response):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CostaRicaPoderJudicialRecords(SimpleSpider):
def start_requests(self):
url = 'https://ckanpj.azurewebsites.net/api/3/action/package_show?id=estandar-de-datos-de' \
'-contrataciones-abiertas-ocds'
yield scrapy.Request(url, meta={'file_name': 'list.json'}, callback=self.parse_list)
yield scrapy.Request(url, meta={'file_name': 'package_show.json'}, callback=self.parse_list)

@handle_http_error
def parse_list(self, response):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CostaRicaPoderJudicialReleases(CompressedFileSpider):
def start_requests(self):
url = 'https://ckanpj.azurewebsites.net/api/3/action/package_show?id=estandar-de-datos-de-contrataciones' \
'-abiertas-ocds'
yield scrapy.Request(url, meta={'file_name': 'list.json'}, callback=self.parse_list)
yield scrapy.Request(url, meta={'file_name': 'package_show.json'}, callback=self.parse_list)

@handle_http_error
def parse_list(self, response):
Expand Down
2 changes: 1 addition & 1 deletion kingfisher_scrapy/spiders/france.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def start_requests(self):
# https://www.data.gouv.fr/fr/datasets/donnees-essentielles-de-la-commande-publique-fichiers-consolides/
url = 'https://www.data.gouv.fr/api/1/datasets/donnees-essentielles-de-la-commande-publique-fichiers' \
'-consolides/'
yield scrapy.Request(url, meta={'file_name': 'page-1.json'}, callback=self.parse_list)
yield scrapy.Request(url, meta={'file_name': 'package_show.json'}, callback=self.parse_list)

@handle_http_error
def parse_list(self, response):
Expand Down
2 changes: 1 addition & 1 deletion kingfisher_scrapy/spiders/italy_anac.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ItalyANAC(SimpleSpider):

def start_requests(self):
url = 'https://dati.anticorruzione.it/opendata/api/3/action/package_search?q=ocds'
yield scrapy.Request(url, meta={'file_name': 'list.json'}, callback=self.parse_list)
yield scrapy.Request(url, meta={'file_name': 'package_search.json'}, callback=self.parse_list)

@handle_http_error
def parse_list(self, response):
Expand Down
6 changes: 1 addition & 5 deletions kingfisher_scrapy/spiders/nigeria_budeshi_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ class NigeriaBudeshiBase(SimpleSpider):
base_url = 'https://budeshi.ng/api/'

def start_requests(self):
yield scrapy.Request(
f'{self.base_url}project_list',
meta={'file_name': 'project_list.json'},
callback=self.parse_list
)
yield scrapy.Request(f'{self.base_url}project_list', meta={'file_name': 'list.json'}, callback=self.parse_list)

@handle_http_error
def parse_list(self, response):
Expand Down
2 changes: 1 addition & 1 deletion kingfisher_scrapy/spiders/portugal_bulk.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class PortugalBulk(CompressedFileSpider):
def start_requests(self):
# A CKAN API JSON response.
url = 'https://dados.gov.pt/api/1/datasets/?q=ocds&organization=5ae97fa2c8d8c915d5faa3bf&page_size=20'
yield scrapy.Request(url, meta={'file_name': 'page-1.json'}, callback=self.parse_list)
yield scrapy.Request(url, meta={'file_name': 'package_search.json'}, callback=self.parse_list)

@handle_http_error
def parse_list(self, response):
Expand Down
2 changes: 1 addition & 1 deletion kingfisher_scrapy/spiders/uruguay_historical.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class UruguayHistorical(CompressedFileSpider):
def start_requests(self):
# A CKAN API JSON response.
url = 'https://catalogodatos.gub.uy/api/3/action/package_show?id=arce-datos-historicos-de-compras'
yield scrapy.Request(url, meta={'file_name': 'list.json'}, callback=self.parse_list)
yield scrapy.Request(url, meta={'file_name': 'package_show.json'}, callback=self.parse_list)

@handle_http_error
def parse_list(self, response):
Expand Down

0 comments on commit 49528bf

Please sign in to comment.