hdx-python-scraper 2.5.0__tar.gz → 2.5.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/.config/pre-commit-config.yaml +3 -3
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/PKG-INFO +5 -5
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/pyproject.toml +9 -3
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/requirements.txt +55 -54
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/_version.py +2 -2
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/base_scraper.py +1 -1
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/runner.py +8 -8
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/scrapers/configurable_scraper.py +5 -5
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/scrapers/test_national.py +10 -10
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/scrapers/unhcr_myanmar_idps.py +2 -2
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/.config/coveragerc +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/.config/pytest.ini +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/.config/ruff.toml +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/.github/workflows/publish.yaml +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/.github/workflows/run-python-tests.yaml +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/.gitignore +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/CONTRIBUTING.md +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/LICENSE +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/README.md +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/documentation/.readthedocs.yaml +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/documentation/main.md +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/documentation/pydoc-markdown.yaml +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/__init__.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/outputs/__init__.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/outputs/base.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/outputs/excelfile.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/outputs/googlesheets.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/outputs/json.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/scrapers/__init__.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/scrapers/aggregator.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/scrapers/resource_downloader.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/scrapers/rowparser.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/scrapers/timeseries.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/utilities/__init__.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/utilities/fallbacks.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/utilities/reader.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/utilities/region_lookup.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/utilities/sources.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/utilities/writer.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/config/project_configuration.yaml +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/access_2pacx-1vrszjzuyvt9i-mkrq2hbxrul2lx2vihkthqm-lae8nyhqty70zqtcufs3pxbhzgat1l2bkoa4-daoap-pub-gid-574237756-single-true-output-csv.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/additional-json.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/altworldindata_data-tagger-match-all-on-tagger-01-header-location-tagger-01-tag.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/casualties_2pacx-1vqidedbzz0ehrc0b4fswip14r7mdtu1mpmwakuxupelsah2awcurkgalfduhjvyjul8vzzat3r1b5qg-pub-gid-0-single-true-output-csv.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/cbpf-allocations-and-contributions.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/cbpf2-allocations-and-contributions.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/cerf-covid-19-allocations.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/cerf2-covid-19-allocations.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/cerf2_global_download-full-pfmb-allocations.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/cerf_global_download-full-pfmb-allocations.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/covax_2pacx-1vtvzu79pptfaa2syevoqfyrrjy63djwitqu0ffbxiqczoun9k9timwmrvfgg1rbsnlmgyugzseiaye2-pub-gid-992438980-single-true-output-csv.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/covidtests_data-owid-covid-data.xlsx +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/education_closures_broken.xls +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/education_closures_school_closures.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/education_enrolment_enrollment_data.xlsx +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/ethiopia-drought-related-key-figures.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/ethiopia-pin-targeted-reached-by-location-and-cluster.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/ethiopia_drought_affected_targeted_reached_by_cluster.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/fallbacks.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/gam_download-unicef-who-wb-global-expanded-databases-severe-wasting.xlsx +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/gam_other_download-unicef-who-wb-global-expanded-databases-severe-wasting.xlsx +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/global-school-closures-covid19.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/hno_2017_sahel_nutrition.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/hno_2017_sahel_people_in_need.xlsx +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/idmc-internally-displaced-persons-idps.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/idps_download-displacement-data.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/idps_override_population-widget-id-264111-geo-id-693-population-group-54074999.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/idps_somalia_som_unhcr_prmn_displacement_dataset.xlsx +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/ipc_somalia_som_food_insecurity_oct_dec2022_projection.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/kenya-drought-related-key-figures.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/kenya-pin-targeted-reached-by-location-and-cluster.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/kenya_drought_affected_targeted_reached_by_cluster.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/key_figures_2pacx-1vrppqx8jtkkkrckmzfncmmtfecvcpkbp9pdhs1sqtuyacmbsx8tlaxpgblfce-lcehukregguxja-4s-pub-gid-0-single-true-output-csv.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/key_figures_2pacx-1vrppqx8jtkkkrckmzfncmmtfecvcpkbp9pdhs1sqtuyacmbsx8tlaxpgblfce-lcehukregguxja-4s-pub-gid-1275038715-single-true-output-csv.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/key_figures_2pacx-1vrppqx8jtkkkrckmzfncmmtfecvcpkbp9pdhs1sqtuyacmbsx8tlaxpgblfce-lcehukregguxja-4s-pub-gid-2015311116-single-true-output-csv.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/key_figures_eth_2pacx-1vrppqx8jtkkkrckmzfncmmtfecvcpkbp9pdhs1sqtuyacmbsx8tlaxpgblfce-lcehukregguxja-4s-pub-gid-2015311116-single-true-output-csv.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/key_figures_ken_2pacx-1vrppqx8jtkkkrckmzfncmmtfecvcpkbp9pdhs1sqtuyacmbsx8tlaxpgblfce-lcehukregguxja-4s-pub-gid-1275038715-single-true-output-csv.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/key_figures_som_2pacx-1vrppqx8jtkkkrckmzfncmmtfecvcpkbp9pdhs1sqtuyacmbsx8tlaxpgblfce-lcehukregguxja-4s-pub-gid-0-single-true-output-csv.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/ourworldindata_data-tagger-match-all-on-tagger-01-header-location-tagger-01-tag.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/ourworldindata_other_data-tagger-match-all-on-tagger-01-header-location-tagger-01-tag.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/oxcgrt_oxcgrt_csv.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/oxford-covid-19-government-response-tracker.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/population.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/population_indicator-sp-pop-downloadformat-excel-dataformat-list-totl.xls +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/population_other_indicator-sp-pop-downloadformat-excel-dataformat-list-totl.xls +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/regions_tbl_regcov_2020_ocha.xlsx +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/resource_downloader_xlsx_ukr_border_crossings_090622.xlsx +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/sadd-countries-to-include.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/sadd_covid-data-dataset-fullvars-extype-csv.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/sahel-humanitarian-needs-overview.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/sahel-humanitarian-needs-overview_prefix.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/somalia-acute-food-insecurity-country-data.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/somalia-drought-related-key-figures.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/somalia-internally-displaced-persons-idps.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/somalia-pin-targeted-reached-by-location-and-cluster.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/somalia_drought_affected_targeted_reached_by_cluster.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/timeseries_casualties_2pacx-1vqidedbzz0ehrc0b4fswip14r7mdtu1mpmwakuxupelsah2awcurkgalfduhjvyjul8vzzat3r1b5qg-pub-gid-0-single-true-output-csv.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/total-covid-19-tests-performed-by-country.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/ukraine-border-crossings.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/ukraine-who-does-what-where-3w.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/unocha-office-locations.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/who_national2_who-covid-19-global-data.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/who_national3_who-covid-19-global-data.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/who_national_who-covid-19-global-data.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/whowhatwhere_afg_3w_data.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/whowhatwhere_notags_3w_data.csv +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/test_output.xlsx +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/test_scraper_all.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/test_scraper_other.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/test_scraper_population.json +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/__init__.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/conftest.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/custom/__init__.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/custom/affected_targeted_reached.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/custom/education_closures.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/custom/education_enrolment.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/custom/test_custom.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/outputs/__init__.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/outputs/test_output.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/scrapers/__init__.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/scrapers/test_aggregation.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/scrapers/test_appenddata.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/scrapers/test_global.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/scrapers/test_multipleurls.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/scrapers/test_regionaltoplevel.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/scrapers/test_resource_downloaders.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/scrapers/test_subnational.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/scrapers/test_timeseries.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/test_runner.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/utilities/__init__.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/utilities/test_readers.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/utilities/test_regionlookup.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/utilities/test_sources.py +0 -0
- {hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/utilities/test_utils.py +0 -0
|
@@ -2,14 +2,14 @@ default_language_version:
|
|
|
2
2
|
python: python3.12
|
|
3
3
|
repos:
|
|
4
4
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
5
|
-
rev:
|
|
5
|
+
rev: v5.0.0
|
|
6
6
|
hooks:
|
|
7
7
|
- id: trailing-whitespace
|
|
8
8
|
- id: end-of-file-fixer
|
|
9
9
|
exclude: test_scraper_.*\.json
|
|
10
10
|
- id: check-ast
|
|
11
11
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
12
|
-
rev: v0.6
|
|
12
|
+
rev: v0.8.6
|
|
13
13
|
hooks:
|
|
14
14
|
# Run the linter.
|
|
15
15
|
- id: ruff
|
|
@@ -18,7 +18,7 @@ repos:
|
|
|
18
18
|
- id: ruff-format
|
|
19
19
|
args: [--config, .config/ruff.toml]
|
|
20
20
|
- repo: https://github.com/astral-sh/uv-pre-commit
|
|
21
|
-
rev: 0.
|
|
21
|
+
rev: 0.5.15
|
|
22
22
|
hooks:
|
|
23
23
|
# Run the pip compile
|
|
24
24
|
- id: pip-compile
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: hdx-python-scraper
|
|
3
|
-
Version: 2.5.
|
|
3
|
+
Version: 2.5.1
|
|
4
4
|
Summary: HDX Python scraper utilities to assemble data from multiple sources
|
|
5
5
|
Project-URL: Homepage, https://github.com/OCHA-DAP/hdx-python-scraper
|
|
6
6
|
Author-email: Michael Rans <rans@email.com>
|
|
@@ -26,9 +26,9 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
26
26
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
27
27
|
Requires-Python: >=3.8
|
|
28
28
|
Requires-Dist: gspread
|
|
29
|
-
Requires-Dist: hdx-python-api>=6.3.
|
|
30
|
-
Requires-Dist: hdx-python-country>=3.
|
|
31
|
-
Requires-Dist: hdx-python-utilities>=3.
|
|
29
|
+
Requires-Dist: hdx-python-api>=6.3.6
|
|
30
|
+
Requires-Dist: hdx-python-country>=3.8.6
|
|
31
|
+
Requires-Dist: hdx-python-utilities>=3.8.0
|
|
32
32
|
Requires-Dist: regex
|
|
33
33
|
Provides-Extra: dev
|
|
34
34
|
Requires-Dist: pre-commit; extra == 'dev'
|
|
@@ -34,9 +34,9 @@ classifiers = [
|
|
|
34
34
|
requires-python = ">=3.8"
|
|
35
35
|
|
|
36
36
|
dependencies = [
|
|
37
|
-
"hdx-python-api>=6.3.
|
|
38
|
-
"hdx-python-country>=3.
|
|
39
|
-
"hdx-python-utilities>=3.
|
|
37
|
+
"hdx-python-api>=6.3.6",
|
|
38
|
+
"hdx-python-country>=3.8.6",
|
|
39
|
+
"hdx-python-utilities>=3.8.0",
|
|
40
40
|
"gspread",
|
|
41
41
|
"regex",
|
|
42
42
|
]
|
|
@@ -67,6 +67,9 @@ packages = ["src/hdx"]
|
|
|
67
67
|
[tool.hatch.build.hooks.vcs]
|
|
68
68
|
version-file = "src/hdx/scraper/framework/_version.py"
|
|
69
69
|
|
|
70
|
+
[tool.hatch.metadata]
|
|
71
|
+
allow-direct-references = true
|
|
72
|
+
|
|
70
73
|
# Versioning
|
|
71
74
|
|
|
72
75
|
[tool.hatch.version]
|
|
@@ -91,6 +94,9 @@ run = """
|
|
|
91
94
|
--cov-report=lcov --cov-report=term-missing
|
|
92
95
|
"""
|
|
93
96
|
|
|
97
|
+
[tool.hatch.envs.hatch-static-analysis]
|
|
98
|
+
dependencies = ["ruff==0.8.6"]
|
|
99
|
+
|
|
94
100
|
[tool.hatch.envs.hatch-static-analysis.scripts]
|
|
95
101
|
format-check = ["ruff format --config .config/ruff.toml --check --diff {args:.}",]
|
|
96
102
|
format-fix = ["ruff format --config .config/ruff.toml {args:.}",]
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# uv pip compile pyproject.toml --resolver=backtracking --all-extras -o requirements.txt
|
|
3
3
|
annotated-types==0.7.0
|
|
4
4
|
# via pydantic
|
|
5
|
-
attrs==24.
|
|
5
|
+
attrs==24.3.0
|
|
6
6
|
# via
|
|
7
7
|
# frictionless
|
|
8
8
|
# jsonlines
|
|
@@ -10,25 +10,25 @@ attrs==24.2.0
|
|
|
10
10
|
# referencing
|
|
11
11
|
cachetools==5.5.0
|
|
12
12
|
# via google-auth
|
|
13
|
-
certifi==2024.
|
|
13
|
+
certifi==2024.12.14
|
|
14
14
|
# via requests
|
|
15
15
|
cfgv==3.4.0
|
|
16
16
|
# via pre-commit
|
|
17
17
|
chardet==5.2.0
|
|
18
18
|
# via frictionless
|
|
19
|
-
charset-normalizer==3.
|
|
19
|
+
charset-normalizer==3.4.1
|
|
20
20
|
# via requests
|
|
21
21
|
ckanapi==4.8
|
|
22
22
|
# via hdx-python-api
|
|
23
|
-
click==8.1.
|
|
23
|
+
click==8.1.8
|
|
24
24
|
# via typer
|
|
25
|
-
coverage==7.6.
|
|
25
|
+
coverage==7.6.10
|
|
26
26
|
# via pytest-cov
|
|
27
27
|
defopt==6.4.0
|
|
28
28
|
# via hdx-python-api
|
|
29
|
-
distlib==0.3.
|
|
29
|
+
distlib==0.3.9
|
|
30
30
|
# via virtualenv
|
|
31
|
-
dnspython==2.
|
|
31
|
+
dnspython==2.7.0
|
|
32
32
|
# via email-validator
|
|
33
33
|
docopt==0.6.2
|
|
34
34
|
# via
|
|
@@ -38,34 +38,34 @@ docutils==0.21.2
|
|
|
38
38
|
# via defopt
|
|
39
39
|
email-validator==2.2.0
|
|
40
40
|
# via hdx-python-api
|
|
41
|
-
et-xmlfile==
|
|
41
|
+
et-xmlfile==2.0.0
|
|
42
42
|
# via openpyxl
|
|
43
|
-
filelock==3.16.
|
|
43
|
+
filelock==3.16.1
|
|
44
44
|
# via virtualenv
|
|
45
|
-
frictionless==5.
|
|
45
|
+
frictionless==5.18.0
|
|
46
46
|
# via hdx-python-utilities
|
|
47
|
-
google-auth==2.
|
|
47
|
+
google-auth==2.37.0
|
|
48
48
|
# via
|
|
49
49
|
# google-auth-oauthlib
|
|
50
50
|
# gspread
|
|
51
51
|
google-auth-oauthlib==1.2.1
|
|
52
52
|
# via gspread
|
|
53
|
-
gspread==6.1.
|
|
53
|
+
gspread==6.1.4
|
|
54
54
|
# via hdx-python-scraper (pyproject.toml)
|
|
55
|
-
hdx-python-api==6.3.
|
|
55
|
+
hdx-python-api==6.3.6
|
|
56
56
|
# via hdx-python-scraper (pyproject.toml)
|
|
57
|
-
hdx-python-country==3.
|
|
57
|
+
hdx-python-country==3.8.6
|
|
58
58
|
# via
|
|
59
59
|
# hdx-python-scraper (pyproject.toml)
|
|
60
60
|
# hdx-python-api
|
|
61
|
-
hdx-python-utilities==3.
|
|
61
|
+
hdx-python-utilities==3.8.0
|
|
62
62
|
# via
|
|
63
63
|
# hdx-python-scraper (pyproject.toml)
|
|
64
64
|
# hdx-python-api
|
|
65
65
|
# hdx-python-country
|
|
66
|
-
humanize==4.
|
|
66
|
+
humanize==4.11.0
|
|
67
67
|
# via frictionless
|
|
68
|
-
identify==2.6.
|
|
68
|
+
identify==2.6.5
|
|
69
69
|
# via pre-commit
|
|
70
70
|
idna==3.10
|
|
71
71
|
# via
|
|
@@ -73,37 +73,37 @@ idna==3.10
|
|
|
73
73
|
# requests
|
|
74
74
|
ijson==3.3.0
|
|
75
75
|
# via hdx-python-utilities
|
|
76
|
-
inflect==7.
|
|
76
|
+
inflect==7.5.0
|
|
77
77
|
# via quantulum3
|
|
78
78
|
iniconfig==2.0.0
|
|
79
79
|
# via pytest
|
|
80
|
-
isodate==0.
|
|
80
|
+
isodate==0.7.2
|
|
81
81
|
# via frictionless
|
|
82
|
-
jinja2==3.1.
|
|
82
|
+
jinja2==3.1.5
|
|
83
83
|
# via frictionless
|
|
84
84
|
jsonlines==4.0.0
|
|
85
85
|
# via hdx-python-utilities
|
|
86
|
-
jsonpath-ng==1.
|
|
86
|
+
jsonpath-ng==1.7.0
|
|
87
87
|
# via libhxl
|
|
88
88
|
jsonschema==4.23.0
|
|
89
89
|
# via
|
|
90
90
|
# frictionless
|
|
91
91
|
# tableschema-to-template
|
|
92
|
-
jsonschema-specifications==
|
|
92
|
+
jsonschema-specifications==2024.10.1
|
|
93
93
|
# via jsonschema
|
|
94
|
-
libhxl==5.2.
|
|
94
|
+
libhxl==5.2.2
|
|
95
95
|
# via
|
|
96
96
|
# hdx-python-api
|
|
97
97
|
# hdx-python-country
|
|
98
|
-
loguru==0.7.
|
|
98
|
+
loguru==0.7.3
|
|
99
99
|
# via hdx-python-utilities
|
|
100
|
-
makefun==1.15.
|
|
100
|
+
makefun==1.15.6
|
|
101
101
|
# via hdx-python-api
|
|
102
102
|
markdown-it-py==3.0.0
|
|
103
103
|
# via rich
|
|
104
104
|
marko==2.1.2
|
|
105
105
|
# via frictionless
|
|
106
|
-
markupsafe==
|
|
106
|
+
markupsafe==3.0.2
|
|
107
107
|
# via jinja2
|
|
108
108
|
mdurl==0.1.2
|
|
109
109
|
# via markdown-it-py
|
|
@@ -111,21 +111,21 @@ more-itertools==10.5.0
|
|
|
111
111
|
# via inflect
|
|
112
112
|
nodeenv==1.9.1
|
|
113
113
|
# via pre-commit
|
|
114
|
-
num2words==0.5.
|
|
114
|
+
num2words==0.5.14
|
|
115
115
|
# via quantulum3
|
|
116
|
-
numpy==2.
|
|
116
|
+
numpy==2.2.1
|
|
117
117
|
# via pandas
|
|
118
118
|
oauthlib==3.2.2
|
|
119
119
|
# via requests-oauthlib
|
|
120
120
|
openpyxl==3.1.5
|
|
121
121
|
# via hdx-python-utilities
|
|
122
|
-
packaging==24.
|
|
122
|
+
packaging==24.2
|
|
123
123
|
# via pytest
|
|
124
|
-
pandas==2.2.
|
|
124
|
+
pandas==2.2.3
|
|
125
125
|
# via hdx-python-scraper (pyproject.toml)
|
|
126
126
|
petl==1.7.15
|
|
127
127
|
# via frictionless
|
|
128
|
-
platformdirs==4.3.
|
|
128
|
+
platformdirs==4.3.6
|
|
129
129
|
# via virtualenv
|
|
130
130
|
pluggy==1.5.0
|
|
131
131
|
# via pytest
|
|
@@ -135,7 +135,7 @@ ply==3.11
|
|
|
135
135
|
# libhxl
|
|
136
136
|
pockets==0.9.1
|
|
137
137
|
# via sphinxcontrib-napoleon
|
|
138
|
-
pre-commit==
|
|
138
|
+
pre-commit==4.0.1
|
|
139
139
|
# via hdx-python-scraper (pyproject.toml)
|
|
140
140
|
pyasn1==0.6.1
|
|
141
141
|
# via
|
|
@@ -143,19 +143,19 @@ pyasn1==0.6.1
|
|
|
143
143
|
# rsa
|
|
144
144
|
pyasn1-modules==0.4.1
|
|
145
145
|
# via google-auth
|
|
146
|
-
pydantic==2.
|
|
146
|
+
pydantic==2.10.5
|
|
147
147
|
# via frictionless
|
|
148
|
-
pydantic-core==2.
|
|
148
|
+
pydantic-core==2.27.2
|
|
149
149
|
# via pydantic
|
|
150
|
-
pygments==2.
|
|
150
|
+
pygments==2.19.1
|
|
151
151
|
# via rich
|
|
152
152
|
pyphonetics==0.5.3
|
|
153
|
-
# via hdx-python-
|
|
154
|
-
pytest==8.3.
|
|
153
|
+
# via hdx-python-utilities
|
|
154
|
+
pytest==8.3.4
|
|
155
155
|
# via
|
|
156
156
|
# hdx-python-scraper (pyproject.toml)
|
|
157
157
|
# pytest-cov
|
|
158
|
-
pytest-cov==
|
|
158
|
+
pytest-cov==6.0.0
|
|
159
159
|
# via hdx-python-scraper (pyproject.toml)
|
|
160
160
|
python-dateutil==2.9.0.post0
|
|
161
161
|
# via
|
|
@@ -184,7 +184,7 @@ referencing==0.35.1
|
|
|
184
184
|
# via
|
|
185
185
|
# jsonschema
|
|
186
186
|
# jsonschema-specifications
|
|
187
|
-
regex==2024.
|
|
187
|
+
regex==2024.11.6
|
|
188
188
|
# via hdx-python-scraper (pyproject.toml)
|
|
189
189
|
requests==2.32.3
|
|
190
190
|
# via
|
|
@@ -200,30 +200,29 @@ requests-oauthlib==2.0.0
|
|
|
200
200
|
# via google-auth-oauthlib
|
|
201
201
|
rfc3986==2.0.0
|
|
202
202
|
# via frictionless
|
|
203
|
-
rich==13.
|
|
203
|
+
rich==13.9.4
|
|
204
204
|
# via typer
|
|
205
|
-
rpds-py==0.
|
|
205
|
+
rpds-py==0.22.3
|
|
206
206
|
# via
|
|
207
207
|
# jsonschema
|
|
208
208
|
# referencing
|
|
209
209
|
rsa==4.9
|
|
210
210
|
# via google-auth
|
|
211
|
-
ruamel-yaml==0.18.
|
|
211
|
+
ruamel-yaml==0.18.10
|
|
212
212
|
# via hdx-python-utilities
|
|
213
|
-
ruamel-yaml-clib==0.2.
|
|
213
|
+
ruamel-yaml-clib==0.2.12
|
|
214
214
|
# via ruamel-yaml
|
|
215
|
-
setuptools==75.
|
|
215
|
+
setuptools==75.8.0
|
|
216
216
|
# via ckanapi
|
|
217
217
|
shellingham==1.5.4
|
|
218
218
|
# via typer
|
|
219
|
-
simpleeval==0.
|
|
219
|
+
simpleeval==1.0.3
|
|
220
220
|
# via frictionless
|
|
221
221
|
simplejson==3.19.3
|
|
222
222
|
# via ckanapi
|
|
223
|
-
six==1.
|
|
223
|
+
six==1.17.0
|
|
224
224
|
# via
|
|
225
225
|
# ckanapi
|
|
226
|
-
# isodate
|
|
227
226
|
# pockets
|
|
228
227
|
# python-dateutil
|
|
229
228
|
# sphinxcontrib-napoleon
|
|
@@ -237,11 +236,13 @@ tableschema-to-template==0.0.13
|
|
|
237
236
|
# via hdx-python-utilities
|
|
238
237
|
tabulate==0.9.0
|
|
239
238
|
# via frictionless
|
|
239
|
+
tenacity==9.0.0
|
|
240
|
+
# via hdx-python-country
|
|
240
241
|
text-unidecode==1.3
|
|
241
242
|
# via python-slugify
|
|
242
|
-
typeguard==4.
|
|
243
|
+
typeguard==4.4.1
|
|
243
244
|
# via inflect
|
|
244
|
-
typer==0.
|
|
245
|
+
typer==0.15.1
|
|
245
246
|
# via frictionless
|
|
246
247
|
typing-extensions==4.12.2
|
|
247
248
|
# via
|
|
@@ -250,27 +251,27 @@ typing-extensions==4.12.2
|
|
|
250
251
|
# pydantic-core
|
|
251
252
|
# typeguard
|
|
252
253
|
# typer
|
|
253
|
-
tzdata==2024.
|
|
254
|
+
tzdata==2024.2
|
|
254
255
|
# via pandas
|
|
255
256
|
unidecode==1.3.8
|
|
256
257
|
# via
|
|
257
258
|
# libhxl
|
|
258
259
|
# pyphonetics
|
|
259
|
-
urllib3==2.
|
|
260
|
+
urllib3==2.3.0
|
|
260
261
|
# via
|
|
261
262
|
# libhxl
|
|
262
263
|
# requests
|
|
263
264
|
validators==0.34.0
|
|
264
265
|
# via frictionless
|
|
265
|
-
virtualenv==20.
|
|
266
|
+
virtualenv==20.28.1
|
|
266
267
|
# via pre-commit
|
|
267
|
-
wheel==0.
|
|
268
|
+
wheel==0.45.1
|
|
268
269
|
# via libhxl
|
|
269
270
|
xlrd==2.0.1
|
|
270
271
|
# via hdx-python-utilities
|
|
271
272
|
xlrd3==1.1.0
|
|
272
273
|
# via libhxl
|
|
273
|
-
xlsx2csv==0.8.
|
|
274
|
+
xlsx2csv==0.8.4
|
|
274
275
|
# via hdx-python-utilities
|
|
275
276
|
xlsxwriter==3.2.0
|
|
276
277
|
# via tableschema-to-template
|
{hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/base_scraper.py
RENAMED
|
@@ -36,7 +36,7 @@ class BaseScraper(ABC):
|
|
|
36
36
|
self.reader = datasetinfo.get("reader", name)
|
|
37
37
|
self.setup(headers, source_configuration)
|
|
38
38
|
self.datasetinfo = deepcopy(datasetinfo)
|
|
39
|
-
self.
|
|
39
|
+
self.error_handler = None
|
|
40
40
|
self.can_fallback = True
|
|
41
41
|
|
|
42
42
|
def setup(
|
|
@@ -16,7 +16,7 @@ from .utilities.reader import Read
|
|
|
16
16
|
from .utilities.sources import Sources
|
|
17
17
|
from hdx.location.adminlevel import AdminLevel
|
|
18
18
|
from hdx.utilities.dateparse import now_utc
|
|
19
|
-
from hdx.utilities.
|
|
19
|
+
from hdx.utilities.error_handler import ErrorHandler
|
|
20
20
|
from hdx.utilities.typehint import ListTuple
|
|
21
21
|
|
|
22
22
|
logger = logging.getLogger(__name__)
|
|
@@ -28,7 +28,7 @@ class Runner:
|
|
|
28
28
|
Args:
|
|
29
29
|
countryiso3s (ListTuple[str]): List of ISO3 country codes to process
|
|
30
30
|
today (datetime): Value to use for today. Defaults to now_utc().
|
|
31
|
-
|
|
31
|
+
error_handler (ErrorHandler): ErrorHandler object that logs errors on exit
|
|
32
32
|
scrapers_to_run (Optional[ListTuple[str]]): Scrapers to run. Defaults to None (all scrapers).
|
|
33
33
|
"""
|
|
34
34
|
|
|
@@ -36,12 +36,12 @@ class Runner:
|
|
|
36
36
|
self,
|
|
37
37
|
countryiso3s: ListTuple[str],
|
|
38
38
|
today: datetime = now_utc(),
|
|
39
|
-
|
|
39
|
+
error_handler: Optional[ErrorHandler] = None,
|
|
40
40
|
scrapers_to_run: Optional[ListTuple[str]] = None,
|
|
41
41
|
):
|
|
42
42
|
self.countryiso3s = countryiso3s
|
|
43
43
|
self.today = today
|
|
44
|
-
self.
|
|
44
|
+
self.error_handler = error_handler
|
|
45
45
|
if isinstance(scrapers_to_run, tuple):
|
|
46
46
|
scrapers_to_run = list(scrapers_to_run)
|
|
47
47
|
self.scrapers_to_run: Optional[List[str]] = scrapers_to_run
|
|
@@ -73,7 +73,7 @@ class Runner:
|
|
|
73
73
|
and scraper_name not in self.scrapers_to_run
|
|
74
74
|
):
|
|
75
75
|
self.scrapers_to_run.append(scraper_name)
|
|
76
|
-
scraper.
|
|
76
|
+
scraper.error_handler = self.error_handler
|
|
77
77
|
return scraper_name
|
|
78
78
|
|
|
79
79
|
def add_customs(
|
|
@@ -142,7 +142,7 @@ class Runner:
|
|
|
142
142
|
level_name,
|
|
143
143
|
source_configuration,
|
|
144
144
|
self.today,
|
|
145
|
-
self.
|
|
145
|
+
self.error_handler,
|
|
146
146
|
)
|
|
147
147
|
if scraper_name not in self.scraper_names:
|
|
148
148
|
self.scraper_names.append(scraper_name)
|
|
@@ -612,8 +612,8 @@ class Runner:
|
|
|
612
612
|
if not Fallbacks.exist() or scraper.can_fallback is False:
|
|
613
613
|
raise
|
|
614
614
|
logger.exception(f"Using fallbacks for {scraper.name}!")
|
|
615
|
-
if self.
|
|
616
|
-
self.
|
|
615
|
+
if self.error_handler:
|
|
616
|
+
self.error_handler.add(
|
|
617
617
|
f"Using fallbacks for {scraper.name}! Error: {format_exc()}"
|
|
618
618
|
)
|
|
619
619
|
for level in scraper.headers.keys():
|
|
@@ -17,7 +17,7 @@ from hdx.utilities.dateparse import (
|
|
|
17
17
|
)
|
|
18
18
|
from hdx.utilities.dictandlist import dict_of_lists_add
|
|
19
19
|
from hdx.utilities.downloader import DownloadError
|
|
20
|
-
from hdx.utilities.
|
|
20
|
+
from hdx.utilities.error_handler import ErrorHandler
|
|
21
21
|
from hdx.utilities.text import ( # noqa: F401
|
|
22
22
|
get_fraction_str,
|
|
23
23
|
get_numeric_if_possible,
|
|
@@ -42,7 +42,7 @@ class ConfigurableScraper(BaseScraper):
|
|
|
42
42
|
level_name (Optional[str]): Customised level_name name. Defaults to None (level).
|
|
43
43
|
source_configuration (Dict): Configuration for sources. Defaults to empty dict (use defaults).
|
|
44
44
|
today (datetime): Value to use for today. Defaults to now_utc().
|
|
45
|
-
|
|
45
|
+
error_handler (Optional[ErrorHandler]): ErrorHandler object that logs errors on exit
|
|
46
46
|
**kwargs: Variables to use when evaluating template arguments in urls
|
|
47
47
|
"""
|
|
48
48
|
|
|
@@ -67,7 +67,7 @@ class ConfigurableScraper(BaseScraper):
|
|
|
67
67
|
level_name: Optional[str] = None,
|
|
68
68
|
source_configuration: Dict = {},
|
|
69
69
|
today: datetime = now_utc(),
|
|
70
|
-
|
|
70
|
+
error_handler: Optional[ErrorHandler] = None,
|
|
71
71
|
**kwargs: Any,
|
|
72
72
|
):
|
|
73
73
|
self.name = name
|
|
@@ -83,10 +83,10 @@ class ConfigurableScraper(BaseScraper):
|
|
|
83
83
|
else:
|
|
84
84
|
self.level_name: str = level_name
|
|
85
85
|
self.countryiso3s = countryiso3s
|
|
86
|
-
self.adminlevel = adminlevel
|
|
86
|
+
self.adminlevel: Optional[AdminLevel] = adminlevel
|
|
87
87
|
self.today = today
|
|
88
88
|
self.subsets = self.get_subsets_from_datasetinfo(datasetinfo)
|
|
89
|
-
self.
|
|
89
|
+
self.error_handler: Optional[ErrorHandler] = error_handler
|
|
90
90
|
self.variables = kwargs
|
|
91
91
|
self.rowparser = None
|
|
92
92
|
self.datasetinfo = copy.deepcopy(datasetinfo)
|
|
@@ -6,7 +6,7 @@ from hdx.scraper.framework.runner import Runner
|
|
|
6
6
|
from hdx.scraper.framework.utilities.reader import Read
|
|
7
7
|
from hdx.scraper.framework.utilities.writer import Writer
|
|
8
8
|
from hdx.utilities.dateparse import parse_date
|
|
9
|
-
from hdx.utilities.
|
|
9
|
+
from hdx.utilities.error_handler import ErrorHandler
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class TestNational:
|
|
@@ -508,11 +508,11 @@ class TestNational:
|
|
|
508
508
|
run_check_scraper(name, runner, level, headers, values, sources)
|
|
509
509
|
|
|
510
510
|
today = parse_date("2021-05-03")
|
|
511
|
-
|
|
511
|
+
error_handler = ErrorHandler()
|
|
512
512
|
runner = Runner(
|
|
513
513
|
("AFG", "PHL"),
|
|
514
514
|
today,
|
|
515
|
-
|
|
515
|
+
error_handler=error_handler,
|
|
516
516
|
)
|
|
517
517
|
runner.add_configurables(scraper_configuration, level)
|
|
518
518
|
name = "ourworldindata"
|
|
@@ -567,7 +567,7 @@ class TestNational:
|
|
|
567
567
|
sources,
|
|
568
568
|
fallbacks_used=True,
|
|
569
569
|
)
|
|
570
|
-
error =
|
|
570
|
+
error = error_handler.shared_errors["error"][""].pop()
|
|
571
571
|
assert "Using fallbacks for broken_owd_url!" in error
|
|
572
572
|
assert (
|
|
573
573
|
"No such file or directory: 'tests/fixtures/input/broken_owd_url_notexist.csv'"
|
|
@@ -577,7 +577,7 @@ class TestNational:
|
|
|
577
577
|
def test_get_national_afg_mmr_phl(self, configuration):
|
|
578
578
|
BaseScraper.population_lookup = {}
|
|
579
579
|
today = parse_date("2021-05-03")
|
|
580
|
-
|
|
580
|
+
error_handler = ErrorHandler()
|
|
581
581
|
level = "national"
|
|
582
582
|
countries = ("AFG", "MMR", "PHL")
|
|
583
583
|
scraper_configuration = configuration[f"scraper_{level}"]
|
|
@@ -585,7 +585,7 @@ class TestNational:
|
|
|
585
585
|
runner = Runner(
|
|
586
586
|
countries,
|
|
587
587
|
today,
|
|
588
|
-
|
|
588
|
+
error_handler=error_handler,
|
|
589
589
|
)
|
|
590
590
|
scrapers = runner.add_configurables(scraper_configuration, level)
|
|
591
591
|
name = "idps"
|
|
@@ -631,11 +631,11 @@ class TestNational:
|
|
|
631
631
|
"https://data.unhcr.org/population/?widget_id=264111&geo_id=693&population_group=5407,4999",
|
|
632
632
|
],
|
|
633
633
|
)
|
|
634
|
-
assert
|
|
634
|
+
assert error_handler.shared_errors["error"] == {}
|
|
635
635
|
runner = Runner(
|
|
636
636
|
("AFG", "MMR", "PHL"),
|
|
637
637
|
today,
|
|
638
|
-
|
|
638
|
+
error_handler=error_handler,
|
|
639
639
|
)
|
|
640
640
|
runner.add_configurables(scraper_configuration, level)
|
|
641
641
|
runner.add_instance_variables(
|
|
@@ -654,9 +654,9 @@ class TestNational:
|
|
|
654
654
|
"https://data.humdata.org/dataset/idmc-internally-displaced-persons-idps"
|
|
655
655
|
],
|
|
656
656
|
)
|
|
657
|
-
assert
|
|
657
|
+
assert error_handler.shared_errors["error"][""] == {
|
|
658
658
|
"Not using UNHCR Myanmar IDPs override! Error: [Errno 2] No such file or directory: 'tests/fixtures/input/idps_override_not-exist.json'",
|
|
659
|
-
|
|
659
|
+
}
|
|
660
660
|
runner.run()
|
|
661
661
|
jsonout = JsonFile(configuration["json"], [level])
|
|
662
662
|
outputs = {"json": jsonout}
|
|
@@ -24,5 +24,5 @@ def idps_post_run(self) -> None:
|
|
|
24
24
|
except Exception as ex:
|
|
25
25
|
msg = "Not using UNHCR Myanmar IDPs override!"
|
|
26
26
|
logger.exception(msg)
|
|
27
|
-
if self.
|
|
28
|
-
self.
|
|
27
|
+
if self.error_handler:
|
|
28
|
+
self.error_handler.add(f"{msg} Error: {ex}")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/.github/workflows/run-python-tests.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/outputs/__init__.py
RENAMED
|
File without changes
|
{hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/outputs/base.py
RENAMED
|
File without changes
|
{hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/outputs/excelfile.py
RENAMED
|
File without changes
|
|
File without changes
|
{hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/outputs/json.py
RENAMED
|
File without changes
|
{hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/scrapers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/utilities/reader.py
RENAMED
|
File without changes
|
|
File without changes
|
{hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/utilities/sources.py
RENAMED
|
File without changes
|
{hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/src/hdx/scraper/framework/utilities/writer.py
RENAMED
|
File without changes
|
{hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/config/project_configuration.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/additional-json.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/input/oxcgrt_oxcgrt_csv.csv
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/test_scraper_other.json
RENAMED
|
File without changes
|
{hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/fixtures/test_scraper_population.json
RENAMED
|
File without changes
|
{hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/__init__.py
RENAMED
|
File without changes
|
{hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/conftest.py
RENAMED
|
File without changes
|
{hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/custom/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_scraper-2.5.0 → hdx_python_scraper-2.5.1}/tests/hdx/scraper/framework/test_runner.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|