hdx-python-scraper 2.3.1__tar.gz → 2.3.2__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.
Files changed (131) hide show
  1. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/PKG-INFO +1 -1
  2. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/requirements.txt +10 -10
  3. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/_version.py +2 -2
  4. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/runner.py +32 -12
  5. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/education_closures.py +1 -1
  6. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/test_scrapers_custom.py +94 -50
  7. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/.config/black.toml +0 -0
  8. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/.config/coveragerc +0 -0
  9. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/.config/pre-commit-config.yaml +0 -0
  10. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/.config/pytest.ini +0 -0
  11. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/.config/ruff.toml +0 -0
  12. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/.github/workflows/publish.yaml +0 -0
  13. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/.github/workflows/run-python-tests.yaml +0 -0
  14. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/.gitignore +0 -0
  15. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/CONTRIBUTING.md +0 -0
  16. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/LICENSE +0 -0
  17. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/README.md +0 -0
  18. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/documentation/.readthedocs.yaml +0 -0
  19. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/documentation/main.md +0 -0
  20. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/documentation/pydoc-markdown.yaml +0 -0
  21. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/pyproject.toml +0 -0
  22. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/__init__.py +0 -0
  23. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/base_scraper.py +0 -0
  24. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/configurable/__init__.py +0 -0
  25. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/configurable/aggregator.py +0 -0
  26. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/configurable/resource_downloader.py +0 -0
  27. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/configurable/rowparser.py +0 -0
  28. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/configurable/scraper.py +0 -0
  29. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/configurable/timeseries.py +0 -0
  30. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/outputs/__init__.py +0 -0
  31. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/outputs/base.py +0 -0
  32. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/outputs/excelfile.py +0 -0
  33. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/outputs/googlesheets.py +0 -0
  34. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/outputs/json.py +0 -0
  35. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/utilities/__init__.py +0 -0
  36. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/utilities/fallbacks.py +0 -0
  37. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/utilities/reader.py +0 -0
  38. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/utilities/region_lookup.py +0 -0
  39. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/utilities/sources.py +0 -0
  40. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/src/hdx/scraper/utilities/writer.py +0 -0
  41. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/config/project_configuration.yaml +0 -0
  42. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/access_2pacx-1vrszjzuyvt9i-mkrq2hbxrul2lx2vihkthqm-lae8nyhqty70zqtcufs3pxbhzgat1l2bkoa4-daoap-pub-gid-574237756-single-true-output-csv.csv +0 -0
  43. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/additional-json.json +0 -0
  44. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/altworldindata_data-tagger-match-all-on-tagger-01-header-location-tagger-01-tag.csv +0 -0
  45. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/casualties_2pacx-1vqidedbzz0ehrc0b4fswip14r7mdtu1mpmwakuxupelsah2awcurkgalfduhjvyjul8vzzat3r1b5qg-pub-gid-0-single-true-output-csv.csv +0 -0
  46. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/cbpf-allocations-and-contributions.json +0 -0
  47. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/cbpf2-allocations-and-contributions.json +0 -0
  48. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/cerf-covid-19-allocations.json +0 -0
  49. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/cerf2-covid-19-allocations.json +0 -0
  50. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/cerf2_global_download-full-pfmb-allocations.csv +0 -0
  51. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/cerf_global_download-full-pfmb-allocations.csv +0 -0
  52. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/covax_2pacx-1vtvzu79pptfaa2syevoqfyrrjy63djwitqu0ffbxiqczoun9k9timwmrvfgg1rbsnlmgyugzseiaye2-pub-gid-992438980-single-true-output-csv.csv +0 -0
  53. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/covidtests_data-owid-covid-data.xlsx +0 -0
  54. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/education_closures_broken.xls +0 -0
  55. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/education_closures_school_closures.csv +0 -0
  56. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/education_enrolment_download-countries-enrollment-data-uis-feb-22.xlsx +0 -0
  57. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/ethiopia-drought-related-key-figures.json +0 -0
  58. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/ethiopia-pin-targeted-reached-by-location-and-cluster.json +0 -0
  59. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/ethiopia_drought_affected_targeted_reached_by_cluster.csv +0 -0
  60. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/fallbacks.json +0 -0
  61. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/gam_download-unicef-who-wb-global-expanded-databases-severe-wasting.xlsx +0 -0
  62. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/gam_other_download-unicef-who-wb-global-expanded-databases-severe-wasting.xlsx +0 -0
  63. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/global-school-closures-covid19.json +0 -0
  64. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/hno_2017_sahel_nutrition.csv +0 -0
  65. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/hno_2017_sahel_people_in_need.xlsx +0 -0
  66. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/idmc-internally-displaced-persons-idps.json +0 -0
  67. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/idps_download-displacement-data.csv +0 -0
  68. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/idps_override_population-widget-id-264111-geo-id-693-population-group-54074999.json +0 -0
  69. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/idps_somalia_som_unhcr_prmn_displacement_dataset.xlsx +0 -0
  70. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/ipc_somalia_som_food_insecurity_oct_dec2022_projection.csv +0 -0
  71. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/kenya-drought-related-key-figures.json +0 -0
  72. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/kenya-pin-targeted-reached-by-location-and-cluster.json +0 -0
  73. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/kenya_drought_affected_targeted_reached_by_cluster.csv +0 -0
  74. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/key_figures_2pacx-1vrppqx8jtkkkrckmzfncmmtfecvcpkbp9pdhs1sqtuyacmbsx8tlaxpgblfce-lcehukregguxja-4s-pub-gid-0-single-true-output-csv.csv +0 -0
  75. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/key_figures_2pacx-1vrppqx8jtkkkrckmzfncmmtfecvcpkbp9pdhs1sqtuyacmbsx8tlaxpgblfce-lcehukregguxja-4s-pub-gid-1275038715-single-true-output-csv.csv +0 -0
  76. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/key_figures_2pacx-1vrppqx8jtkkkrckmzfncmmtfecvcpkbp9pdhs1sqtuyacmbsx8tlaxpgblfce-lcehukregguxja-4s-pub-gid-2015311116-single-true-output-csv.csv +0 -0
  77. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/key_figures_eth_2pacx-1vrppqx8jtkkkrckmzfncmmtfecvcpkbp9pdhs1sqtuyacmbsx8tlaxpgblfce-lcehukregguxja-4s-pub-gid-2015311116-single-true-output-csv.csv +0 -0
  78. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/key_figures_ken_2pacx-1vrppqx8jtkkkrckmzfncmmtfecvcpkbp9pdhs1sqtuyacmbsx8tlaxpgblfce-lcehukregguxja-4s-pub-gid-1275038715-single-true-output-csv.csv +0 -0
  79. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/key_figures_som_2pacx-1vrppqx8jtkkkrckmzfncmmtfecvcpkbp9pdhs1sqtuyacmbsx8tlaxpgblfce-lcehukregguxja-4s-pub-gid-0-single-true-output-csv.csv +0 -0
  80. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/ourworldindata_data-tagger-match-all-on-tagger-01-header-location-tagger-01-tag.csv +0 -0
  81. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/ourworldindata_other_data-tagger-match-all-on-tagger-01-header-location-tagger-01-tag.csv +0 -0
  82. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/oxcgrt_oxcgrt_csv.csv +0 -0
  83. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/oxford-covid-19-government-response-tracker.json +0 -0
  84. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/population.json +0 -0
  85. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/population_indicator-sp-pop-downloadformat-excel-dataformat-list-totl.xls +0 -0
  86. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/population_other_indicator-sp-pop-downloadformat-excel-dataformat-list-totl.xls +0 -0
  87. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/regions_tbl_regcov_2020_ocha.xlsx +0 -0
  88. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/resource_downloader_xlsx_ukr_border_crossings_090622.xlsx +0 -0
  89. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/sadd-countries-to-include.csv +0 -0
  90. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/sadd_covid-data-dataset-fullvars-extype-csv.csv +0 -0
  91. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/sahel-humanitarian-needs-overview.json +0 -0
  92. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/sahel-humanitarian-needs-overview_prefix.json +0 -0
  93. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/somalia-acute-food-insecurity-country-data.json +0 -0
  94. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/somalia-drought-related-key-figures.json +0 -0
  95. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/somalia-internally-displaced-persons-idps.json +0 -0
  96. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/somalia-pin-targeted-reached-by-location-and-cluster.json +0 -0
  97. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/somalia_drought_affected_targeted_reached_by_cluster.csv +0 -0
  98. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/timeseries_casualties_2pacx-1vqidedbzz0ehrc0b4fswip14r7mdtu1mpmwakuxupelsah2awcurkgalfduhjvyjul8vzzat3r1b5qg-pub-gid-0-single-true-output-csv.csv +0 -0
  99. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/total-covid-19-tests-performed-by-country.json +0 -0
  100. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/ukraine-border-crossings.json +0 -0
  101. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/ukraine-who-does-what-where-3w.json +0 -0
  102. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/unocha-office-locations.json +0 -0
  103. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/who_national2_who-covid-19-global-data.csv +0 -0
  104. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/who_national3_who-covid-19-global-data.csv +0 -0
  105. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/who_national_who-covid-19-global-data.csv +0 -0
  106. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/whowhatwhere_afg_3w_data.csv +0 -0
  107. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/input/whowhatwhere_notags_3w_data.csv +0 -0
  108. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/test_output.xlsx +0 -0
  109. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/test_scraper_all.json +0 -0
  110. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/test_scraper_other.json +0 -0
  111. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/fixtures/test_scraper_population.json +0 -0
  112. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/__init__.py +0 -0
  113. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/affected_targeted_reached.py +0 -0
  114. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/conftest.py +0 -0
  115. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/education_enrolment.py +0 -0
  116. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/test_output.py +0 -0
  117. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/test_readers.py +0 -0
  118. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/test_regionlookup.py +0 -0
  119. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/test_runner.py +0 -0
  120. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/test_scrapers_aggregation.py +0 -0
  121. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/test_scrapers_appenddata.py +0 -0
  122. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/test_scrapers_global.py +0 -0
  123. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/test_scrapers_multipleurls.py +0 -0
  124. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/test_scrapers_national.py +0 -0
  125. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/test_scrapers_regionaltoplevel.py +0 -0
  126. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/test_scrapers_resource_downloaders.py +0 -0
  127. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/test_scrapers_subnational.py +0 -0
  128. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/test_scrapers_timeseries.py +0 -0
  129. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/test_sources.py +0 -0
  130. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/test_utils.py +0 -0
  131. {hdx_python_scraper-2.3.1 → hdx_python_scraper-2.3.2}/tests/hdx/scraper/unhcr_myanmar_idps.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hdx-python-scraper
3
- Version: 2.3.1
3
+ Version: 2.3.2
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>
@@ -6,7 +6,7 @@
6
6
  #
7
7
  annotated-types==0.6.0
8
8
  # via pydantic
9
- attrs==23.1.0
9
+ attrs==23.2.0
10
10
  # via
11
11
  # frictionless
12
12
  # jsonlines
@@ -29,7 +29,7 @@ click==8.1.7
29
29
  # via typer
30
30
  colorama==0.4.6
31
31
  # via typer
32
- coverage[toml]==7.3.2
32
+ coverage[toml]==7.4.0
33
33
  # via pytest-cov
34
34
  cryptography==41.0.7
35
35
  # via pyopenssl
@@ -59,7 +59,7 @@ google-auth==2.25.2
59
59
  # gspread
60
60
  google-auth-oauthlib==1.2.0
61
61
  # via gspread
62
- gspread==5.12.2
62
+ gspread==5.12.4
63
63
  # via hdx-python-scraper (pyproject.toml)
64
64
  hdx-python-api==6.2.0
65
65
  # via hdx-python-scraper (pyproject.toml)
@@ -119,7 +119,7 @@ nodeenv==1.8.0
119
119
  # via pre-commit
120
120
  num2words==0.5.13
121
121
  # via quantulum3
122
- numpy==1.26.2
122
+ numpy==1.26.3
123
123
  # via pandas
124
124
  oauthlib==3.2.2
125
125
  # via requests-oauthlib
@@ -153,11 +153,11 @@ pyasn1-modules==0.3.0
153
153
  # via google-auth
154
154
  pycparser==2.21
155
155
  # via cffi
156
- pydantic==2.5.2
156
+ pydantic==2.5.3
157
157
  # via
158
158
  # frictionless
159
159
  # inflect
160
- pydantic-core==2.14.5
160
+ pydantic-core==2.14.6
161
161
  # via pydantic
162
162
  pygments==2.17.2
163
163
  # via rich
@@ -169,7 +169,7 @@ pyphonetics==0.5.3
169
169
  # via hdx-python-country
170
170
  pyrsistent==0.20.0
171
171
  # via jsonschema
172
- pytest==7.4.3
172
+ pytest==7.4.4
173
173
  # via
174
174
  # hdx-python-scraper (pyproject.toml)
175
175
  # pytest-cov
@@ -198,7 +198,7 @@ quantulum3==0.9.0
198
198
  # via hdx-python-api
199
199
  ratelimit==2.2.1
200
200
  # via hdx-python-utilities
201
- regex==2023.10.3
201
+ regex==2023.12.25
202
202
  # via hdx-python-scraper (pyproject.toml)
203
203
  requests==2.31.0
204
204
  # via
@@ -238,7 +238,7 @@ sphinxcontrib-napoleon==0.7
238
238
  # via defopt
239
239
  stringcase==1.2.0
240
240
  # via frictionless
241
- structlog==23.2.0
241
+ structlog==23.3.0
242
242
  # via libhxl
243
243
  tableschema-to-template==0.0.13
244
244
  # via hdx-python-utilities
@@ -255,7 +255,7 @@ typing-extensions==4.9.0
255
255
  # pydantic
256
256
  # pydantic-core
257
257
  # typer
258
- tzdata==2023.3
258
+ tzdata==2023.4
259
259
  # via pandas
260
260
  unidecode==1.3.7
261
261
  # via
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '2.3.1'
16
- __version_tuple__ = version_tuple = (2, 3, 1)
15
+ __version__ = version = '2.3.2'
16
+ __version_tuple__ = version_tuple = (2, 3, 2)
@@ -1209,32 +1209,52 @@ class Runner:
1209
1209
  """
1210
1210
  if not names:
1211
1211
  names = self.scrapers.keys()
1212
- results = {}
1212
+ hapi_results = {}
1213
1213
 
1214
1214
  def add_results(scraper_level, scrap, levels_used):
1215
- nonlocal results
1215
+ nonlocal hapi_results
1216
1216
 
1217
1217
  if scraper_level in levels_used:
1218
1218
  return
1219
1219
  headers = scrap.headers.get(scraper_level)
1220
1220
  if headers is None:
1221
1221
  return
1222
+ headings = headers[0]
1223
+ hxltags = headers[1]
1222
1224
  values = scrap.get_values(scraper_level)
1223
1225
  hapi_dataset_metadata = scrap.get_hapi_dataset_metadata()
1226
+ if not hapi_dataset_metadata:
1227
+ return
1224
1228
  hapi_resource_metadata = scrap.get_hapi_resource_metadata()
1229
+ if not hapi_resource_metadata:
1230
+ return
1225
1231
  dataset_id = hapi_dataset_metadata["hdx_id"]
1226
- hapi_metadata = results.get(
1232
+ hapi_metadata = hapi_results.get(
1227
1233
  dataset_id, copy(hapi_dataset_metadata)
1228
1234
  )
1229
- level_results = hapi_metadata.get("results", {})
1230
- level_results[scraper_level] = {
1231
- "headers": headers,
1232
- "values": values,
1233
- "hapi_resource_metadata": hapi_resource_metadata,
1234
- }
1235
- hapi_metadata["results"] = level_results
1235
+ results = hapi_metadata.get("results", {})
1236
+ level_results = results.get(scraper_level)
1237
+ if level_results is None:
1238
+ level_results = {
1239
+ "headers": ([], []),
1240
+ "values": [],
1241
+ "hapi_resource_metadata": hapi_resource_metadata,
1242
+ }
1243
+ results[scraper_level] = level_results
1244
+ lev_headings = level_results["headers"][0]
1245
+ lev_hxltags = level_results["headers"][1]
1246
+ lev_values = level_results["values"]
1247
+ for i, hxltag in enumerate(hxltags):
1248
+ if hxltag in lev_hxltags:
1249
+ index = lev_hxltags.index(hxltag)
1250
+ lev_values[index].update(values[i])
1251
+ else:
1252
+ lev_headings.append(headings[i])
1253
+ lev_hxltags.append(hxltag)
1254
+ lev_values.append(values[i])
1255
+ hapi_metadata["results"] = results
1236
1256
  levels_used.add(scraper_level)
1237
- results[dataset_id] = hapi_metadata
1257
+ hapi_results[dataset_id] = hapi_metadata
1238
1258
 
1239
1259
  for name in names:
1240
1260
  if self.scrapers_to_run and not any(
@@ -1247,4 +1267,4 @@ class Runner:
1247
1267
  lvls_used = set()
1248
1268
  for scrap_level in scraper.headers:
1249
1269
  add_results(scrap_level, scraper, lvls_used)
1250
- return results
1270
+ return hapi_results
@@ -38,7 +38,7 @@ class EducationClosures(BaseScraper):
38
38
 
39
39
  def run(self) -> None:
40
40
  closures_headers, closures_iterator = self.get_reader().read(
41
- self.datasetinfo, file_prefix=self.name
41
+ self.datasetinfo, file_prefix="education_closures"
42
42
  )
43
43
  closures = self.get_values("national")[0]
44
44
  closed_countries = self.get_values("regional")[0]
@@ -1,4 +1,4 @@
1
- from copy import deepcopy
1
+ from copy import copy, deepcopy
2
2
  from datetime import datetime, timezone
3
3
 
4
4
  from .affected_targeted_reached import AffectedTargetedReached
@@ -12,6 +12,54 @@ from hdx.utilities.dateparse import parse_date
12
12
 
13
13
 
14
14
  class TestScrapersCustom:
15
+ hapi_values = {
16
+ "hdx_id": "6a41be98-75b9-4365-9ea3-e33d0dd2668b",
17
+ "hdx_stub": "global-school-closures-covid19",
18
+ "hdx_provider_stub": "unesco",
19
+ "hdx_provider_name": "UNESCO",
20
+ "reference_period": {
21
+ "enddate": datetime(2022, 4, 30, 23, 59, 59, tzinfo=timezone.utc),
22
+ "enddate_str": "2022-04-30T23:59:59+00:00",
23
+ "ongoing": False,
24
+ "startdate": datetime(2020, 2, 16, 0, 0, tzinfo=timezone.utc),
25
+ "startdate_str": "2020-02-16T00:00:00+00:00",
26
+ },
27
+ "results": {
28
+ "national": {
29
+ "hapi_resource_metadata": {
30
+ "download_url": "https://data.humdata.org/dataset/6a41be98-75b9-4365-9ea3-e33d0dd2668b/resource/3b5baa74-c928-4cbc-adba-bf543c5d3050/download/covid_impact_education.csv",
31
+ "name": "School " "Closures",
32
+ "format": "csv",
33
+ "hdx_id": "3b5baa74-c928-4cbc-adba-bf543c5d3050",
34
+ "is_hxl": False,
35
+ "update_date": datetime(
36
+ 2022, 4, 4, 9, 56, 5, tzinfo=timezone.utc
37
+ ),
38
+ },
39
+ "headers": (["School Closure"], ["#impact+type"]),
40
+ "values": [{"AFG": "Closed due to COVID-19"}],
41
+ },
42
+ "regional": {
43
+ "hapi_resource_metadata": {
44
+ "download_url": "https://data.humdata.org/dataset/6a41be98-75b9-4365-9ea3-e33d0dd2668b/resource/3b5baa74-c928-4cbc-adba-bf543c5d3050/download/covid_impact_education.csv",
45
+ "name": "School " "Closures",
46
+ "format": "csv",
47
+ "hdx_id": "3b5baa74-c928-4cbc-adba-bf543c5d3050",
48
+ "is_hxl": False,
49
+ "update_date": datetime(
50
+ 2022, 4, 4, 9, 56, 5, tzinfo=timezone.utc
51
+ ),
52
+ },
53
+ "headers": (
54
+ ["No. closed countries"],
55
+ ["#status+country+closed"],
56
+ ),
57
+ "values": [{"ROAP": 1}],
58
+ },
59
+ },
60
+ "title": "Global School Closures COVID-19",
61
+ }
62
+
15
63
  def test_get_custom(self, configuration, fallbacks_json):
16
64
  BaseScraper.population_lookup = {}
17
65
  source_date = "Apr 30, 2022"
@@ -86,55 +134,7 @@ class TestScrapersCustom:
86
134
  }
87
135
  }
88
136
  hapi_results = runner.get_hapi_results()
89
- assert next(iter(hapi_results.values())) == {
90
- "hdx_id": "6a41be98-75b9-4365-9ea3-e33d0dd2668b",
91
- "hdx_stub": "global-school-closures-covid19",
92
- "hdx_provider_stub": "unesco",
93
- "hdx_provider_name": "UNESCO",
94
- "reference_period": {
95
- "enddate": datetime(
96
- 2022, 4, 30, 23, 59, 59, tzinfo=timezone.utc
97
- ),
98
- "enddate_str": "2022-04-30T23:59:59+00:00",
99
- "ongoing": False,
100
- "startdate": datetime(2020, 2, 16, 0, 0, tzinfo=timezone.utc),
101
- "startdate_str": "2020-02-16T00:00:00+00:00",
102
- },
103
- "results": {
104
- "national": {
105
- "hapi_resource_metadata": {
106
- "download_url": "https://data.humdata.org/dataset/6a41be98-75b9-4365-9ea3-e33d0dd2668b/resource/3b5baa74-c928-4cbc-adba-bf543c5d3050/download/covid_impact_education.csv",
107
- "name": "School " "Closures",
108
- "format": "csv",
109
- "hdx_id": "3b5baa74-c928-4cbc-adba-bf543c5d3050",
110
- "is_hxl": False,
111
- "update_date": datetime(
112
- 2022, 4, 4, 9, 56, 5, tzinfo=timezone.utc
113
- ),
114
- },
115
- "headers": (("School Closure",), ("#impact+type",)),
116
- "values": ({"AFG": "Closed due to COVID-19"},),
117
- },
118
- "regional": {
119
- "hapi_resource_metadata": {
120
- "download_url": "https://data.humdata.org/dataset/6a41be98-75b9-4365-9ea3-e33d0dd2668b/resource/3b5baa74-c928-4cbc-adba-bf543c5d3050/download/covid_impact_education.csv",
121
- "name": "School " "Closures",
122
- "format": "csv",
123
- "hdx_id": "3b5baa74-c928-4cbc-adba-bf543c5d3050",
124
- "is_hxl": False,
125
- "update_date": datetime(
126
- 2022, 4, 4, 9, 56, 5, tzinfo=timezone.utc
127
- ),
128
- },
129
- "headers": (
130
- ("No. closed countries",),
131
- ("#status+country+closed",),
132
- ),
133
- "values": ({"ROAP": 1},),
134
- },
135
- },
136
- "title": "Global School Closures COVID-19",
137
- }
137
+ assert next(iter(hapi_results.values())) == self.hapi_values
138
138
 
139
139
  headers = (["No. closed countries"], ["#status+country+closed"])
140
140
  values = [{"ROAP": 1}]
@@ -200,6 +200,50 @@ class TestScrapersCustom:
200
200
  "https://data.humdata.org/dataset/global-school-closures-covid19",
201
201
  "https://data.humdata.org/organization/world-bank-group",
202
202
  ]
203
+ hapi_results = runner.get_hapi_results()
204
+ assert next(iter(hapi_results.values())) == self.hapi_values
205
+ edu_dsinfo = runner.get_scraper(name).datasetinfo
206
+ pop_dsinfo = runner.get_scraper("population").datasetinfo
207
+ # pretend population uses same dataset as education for testing
208
+ pop_dsinfo["hapi_dataset_metadata"] = edu_dsinfo[
209
+ "hapi_dataset_metadata"
210
+ ]
211
+ hapi_results = runner.get_hapi_results()
212
+ assert next(iter(hapi_results.values())) == self.hapi_values
213
+ # pretend population uses same resource as education for testing
214
+ pop_dsinfo["hapi_resource_metadata"] = edu_dsinfo[
215
+ "hapi_resource_metadata"
216
+ ]
217
+ hapi_results = runner.get_hapi_results()
218
+ hapi_values = copy(self.hapi_values)
219
+ hapi_values["results"]["national"]["headers"] = (
220
+ ["School Closure", "Population"],
221
+ ["#impact+type", "#population"],
222
+ )
223
+ hapi_values["results"]["national"]["values"] = [
224
+ {"AFG": "Closed due to COVID-19"},
225
+ {"AFG": 38041754},
226
+ ]
227
+ assert next(iter(hapi_results.values())) == hapi_values
228
+
229
+ education_closures2 = EducationClosures(
230
+ datasetinfo, today, countries, region
231
+ )
232
+ # give it a unique name
233
+ education_closures2.name = f"{education_closures2.name}2"
234
+ runner.add_custom(education_closures2)
235
+ runner.run_one(education_closures2.name)
236
+ # give it a unique result
237
+ del education_closures2.values["national"][0]["AFG"]
238
+ education_closures2.values["national"][0][
239
+ "SDN"
240
+ ] = "Closed due to COVID-19"
241
+ hapi_results = runner.get_hapi_results()
242
+ hapi_values["results"]["national"]["values"] = [
243
+ {"AFG": "Closed due to COVID-19", "SDN": "Closed due to COVID-19"},
244
+ {"AFG": 38041754},
245
+ ]
246
+ assert next(iter(hapi_results.values())) == hapi_values
203
247
 
204
248
  runner = Runner(("AFG",), today)
205
249
  datasetinfo = deepcopy(datasetinfo)