hdx-python-scraper 2.5.8__tar.gz → 2.6.0__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 (148) hide show
  1. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/.config/pre-commit-config.yaml +2 -2
  2. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/PKG-INFO +1 -1
  3. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/pyproject.toml +1 -1
  4. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/requirements.txt +4 -4
  5. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/_version.py +2 -2
  6. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/outputs/json.py +1 -1
  7. hdx_python_scraper-2.6.0/src/hdx/scraper/framework/utilities/hapi_admins.py +75 -0
  8. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/utilities/lookup.py +5 -0
  9. hdx_python_scraper-2.6.0/tests/fixtures/input/download-global-pcode-lengths.csv +158 -0
  10. hdx_python_scraper-2.6.0/tests/fixtures/input/download-global-pcodes-adm-1-2.csv +32769 -0
  11. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/custom/test_custom.py +3 -3
  12. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/test_runner.py +2 -2
  13. hdx_python_scraper-2.6.0/tests/hdx/scraper/framework/utilities/test_hapi_admins.py +184 -0
  14. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/utilities/test_lookup.py +3 -0
  15. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/.config/coveragerc +0 -0
  16. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/.config/pytest.ini +0 -0
  17. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/.config/ruff.toml +0 -0
  18. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/.github/workflows/publish.yaml +0 -0
  19. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/.github/workflows/run-python-tests.yaml +0 -0
  20. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/.gitignore +0 -0
  21. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/CONTRIBUTING.md +0 -0
  22. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/LICENSE +0 -0
  23. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/README.md +0 -0
  24. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/documentation/.readthedocs.yaml +0 -0
  25. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/documentation/main.md +0 -0
  26. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/documentation/pydoc-markdown.yaml +0 -0
  27. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/__init__.py +0 -0
  28. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/base_scraper.py +0 -0
  29. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/outputs/__init__.py +0 -0
  30. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/outputs/base.py +0 -0
  31. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/outputs/excelfile.py +0 -0
  32. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/outputs/googlesheets.py +0 -0
  33. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/runner.py +0 -0
  34. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/scrapers/__init__.py +0 -0
  35. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/scrapers/aggregator.py +0 -0
  36. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/scrapers/configurable_scraper.py +0 -0
  37. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/scrapers/resource_downloader.py +0 -0
  38. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/scrapers/rowparser.py +0 -0
  39. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/scrapers/timeseries.py +0 -0
  40. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/utilities/__init__.py +0 -0
  41. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/utilities/fallbacks.py +0 -0
  42. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/utilities/org_type.py +0 -0
  43. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/utilities/org_type_configuration.yaml +0 -0
  44. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/utilities/reader.py +0 -0
  45. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/utilities/region_lookup.py +0 -0
  46. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/utilities/sector.py +0 -0
  47. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/utilities/sector_configuration.yaml +0 -0
  48. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/utilities/sources.py +0 -0
  49. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/src/hdx/scraper/framework/utilities/writer.py +0 -0
  50. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/config/project_configuration.yaml +0 -0
  51. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/access_2pacx-1vrszjzuyvt9i-mkrq2hbxrul2lx2vihkthqm-lae8nyhqty70zqtcufs3pxbhzgat1l2bkoa4-daoap-pub-gid-574237756-single-true-output-csv.csv +0 -0
  52. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/additional-json.json +0 -0
  53. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/altworldindata_data-tagger-match-all-on-tagger-01-header-location-tagger-01-tag.csv +0 -0
  54. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/casualties_2pacx-1vqidedbzz0ehrc0b4fswip14r7mdtu1mpmwakuxupelsah2awcurkgalfduhjvyjul8vzzat3r1b5qg-pub-gid-0-single-true-output-csv.csv +0 -0
  55. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/cbpf-allocations-and-contributions.json +0 -0
  56. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/cbpf2-allocations-and-contributions.json +0 -0
  57. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/cerf-covid-19-allocations.json +0 -0
  58. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/cerf2-covid-19-allocations.json +0 -0
  59. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/cerf2_global_download-full-pfmb-allocations.csv +0 -0
  60. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/cerf_global_download-full-pfmb-allocations.csv +0 -0
  61. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/covax_2pacx-1vtvzu79pptfaa2syevoqfyrrjy63djwitqu0ffbxiqczoun9k9timwmrvfgg1rbsnlmgyugzseiaye2-pub-gid-992438980-single-true-output-csv.csv +0 -0
  62. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/covidtests_data-owid-covid-data.xlsx +0 -0
  63. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/education_closures_broken.xls +0 -0
  64. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/education_closures_school_closures.csv +0 -0
  65. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/education_enrolment_enrollment_data.xlsx +0 -0
  66. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/ethiopia-drought-related-key-figures.json +0 -0
  67. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/ethiopia-pin-targeted-reached-by-location-and-cluster.json +0 -0
  68. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/ethiopia_drought_affected_targeted_reached_by_cluster.csv +0 -0
  69. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/fallbacks.json +0 -0
  70. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/gam_download-unicef-who-wb-global-expanded-databases-severe-wasting.xlsx +0 -0
  71. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/gam_other_download-unicef-who-wb-global-expanded-databases-severe-wasting.xlsx +0 -0
  72. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/global-coordination-groups-beta.json +0 -0
  73. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/global-school-closures-covid19.json +0 -0
  74. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/hno_2017_sahel_nutrition.csv +0 -0
  75. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/hno_2017_sahel_people_in_need.xlsx +0 -0
  76. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/idmc-internally-displaced-persons-idps.json +0 -0
  77. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/idps_download-displacement-data.csv +0 -0
  78. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/idps_override_population-widget-id-264111-geo-id-693-population-group-54074999.json +0 -0
  79. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/idps_somalia_som_unhcr_prmn_displacement_dataset.xlsx +0 -0
  80. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/ipc_somalia_som_food_insecurity_oct_dec2022_projection.csv +0 -0
  81. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/kenya-drought-related-key-figures.json +0 -0
  82. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/kenya-pin-targeted-reached-by-location-and-cluster.json +0 -0
  83. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/kenya_drought_affected_targeted_reached_by_cluster.csv +0 -0
  84. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/key_figures_2pacx-1vrppqx8jtkkkrckmzfncmmtfecvcpkbp9pdhs1sqtuyacmbsx8tlaxpgblfce-lcehukregguxja-4s-pub-gid-0-single-true-output-csv.csv +0 -0
  85. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/key_figures_2pacx-1vrppqx8jtkkkrckmzfncmmtfecvcpkbp9pdhs1sqtuyacmbsx8tlaxpgblfce-lcehukregguxja-4s-pub-gid-1275038715-single-true-output-csv.csv +0 -0
  86. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/key_figures_2pacx-1vrppqx8jtkkkrckmzfncmmtfecvcpkbp9pdhs1sqtuyacmbsx8tlaxpgblfce-lcehukregguxja-4s-pub-gid-2015311116-single-true-output-csv.csv +0 -0
  87. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/key_figures_eth_2pacx-1vrppqx8jtkkkrckmzfncmmtfecvcpkbp9pdhs1sqtuyacmbsx8tlaxpgblfce-lcehukregguxja-4s-pub-gid-2015311116-single-true-output-csv.csv +0 -0
  88. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/key_figures_ken_2pacx-1vrppqx8jtkkkrckmzfncmmtfecvcpkbp9pdhs1sqtuyacmbsx8tlaxpgblfce-lcehukregguxja-4s-pub-gid-1275038715-single-true-output-csv.csv +0 -0
  89. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/key_figures_som_2pacx-1vrppqx8jtkkkrckmzfncmmtfecvcpkbp9pdhs1sqtuyacmbsx8tlaxpgblfce-lcehukregguxja-4s-pub-gid-0-single-true-output-csv.csv +0 -0
  90. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/org_type_organization_types_beta_csv.csv +0 -0
  91. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/organization-types-beta.json +0 -0
  92. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/ourworldindata_data-tagger-match-all-on-tagger-01-header-location-tagger-01-tag.csv +0 -0
  93. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/ourworldindata_other_data-tagger-match-all-on-tagger-01-header-location-tagger-01-tag.csv +0 -0
  94. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/oxcgrt_oxcgrt_csv.csv +0 -0
  95. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/oxford-covid-19-government-response-tracker.json +0 -0
  96. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/population.json +0 -0
  97. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/population_indicator-sp-pop-downloadformat-excel-dataformat-list-totl.xls +0 -0
  98. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/population_other_indicator-sp-pop-downloadformat-excel-dataformat-list-totl.xls +0 -0
  99. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/regions_tbl_regcov_2020_ocha.xlsx +0 -0
  100. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/resource_downloader_xlsx_ukr_border_crossings_090622.xlsx +0 -0
  101. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/sadd-countries-to-include.csv +0 -0
  102. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/sadd_covid-data-dataset-fullvars-extype-csv.csv +0 -0
  103. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/sahel-humanitarian-needs-overview.json +0 -0
  104. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/sahel-humanitarian-needs-overview_prefix.json +0 -0
  105. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/sector_global_coordination_groups_beta_csv.csv +0 -0
  106. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/somalia-acute-food-insecurity-country-data.json +0 -0
  107. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/somalia-drought-related-key-figures.json +0 -0
  108. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/somalia-internally-displaced-persons-idps.json +0 -0
  109. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/somalia-pin-targeted-reached-by-location-and-cluster.json +0 -0
  110. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/somalia_drought_affected_targeted_reached_by_cluster.csv +0 -0
  111. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/timeseries_casualties_2pacx-1vqidedbzz0ehrc0b4fswip14r7mdtu1mpmwakuxupelsah2awcurkgalfduhjvyjul8vzzat3r1b5qg-pub-gid-0-single-true-output-csv.csv +0 -0
  112. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/total-covid-19-tests-performed-by-country.json +0 -0
  113. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/ukraine-border-crossings.json +0 -0
  114. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/ukraine-who-does-what-where-3w.json +0 -0
  115. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/unocha-office-locations.json +0 -0
  116. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/who_national2_who-covid-19-global-data.csv +0 -0
  117. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/who_national3_who-covid-19-global-data.csv +0 -0
  118. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/who_national_who-covid-19-global-data.csv +0 -0
  119. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/whowhatwhere_afg_3w_data.csv +0 -0
  120. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/input/whowhatwhere_notags_3w_data.csv +0 -0
  121. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/test_output.xlsx +0 -0
  122. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/test_scraper_all.json +0 -0
  123. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/test_scraper_other.json +0 -0
  124. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/fixtures/test_scraper_population.json +0 -0
  125. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/__init__.py +0 -0
  126. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/conftest.py +0 -0
  127. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/custom/__init__.py +0 -0
  128. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/custom/affected_targeted_reached.py +0 -0
  129. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/custom/education_closures.py +0 -0
  130. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/custom/education_enrolment.py +0 -0
  131. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/outputs/__init__.py +0 -0
  132. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/outputs/test_output.py +0 -0
  133. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/scrapers/__init__.py +0 -0
  134. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/scrapers/test_aggregation.py +0 -0
  135. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/scrapers/test_appenddata.py +0 -0
  136. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/scrapers/test_global.py +0 -0
  137. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/scrapers/test_multipleurls.py +0 -0
  138. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/scrapers/test_national.py +0 -0
  139. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/scrapers/test_regionaltoplevel.py +0 -0
  140. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/scrapers/test_resource_downloaders.py +0 -0
  141. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/scrapers/test_subnational.py +0 -0
  142. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/scrapers/test_timeseries.py +0 -0
  143. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/scrapers/unhcr_myanmar_idps.py +0 -0
  144. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/utilities/__init__.py +0 -0
  145. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/utilities/test_readers.py +0 -0
  146. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/utilities/test_regionlookup.py +0 -0
  147. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/utilities/test_sources.py +0 -0
  148. {hdx_python_scraper-2.5.8 → hdx_python_scraper-2.6.0}/tests/hdx/scraper/framework/utilities/test_utils.py +0 -0
@@ -9,7 +9,7 @@ repos:
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.8.6
12
+ rev: v0.9.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.5.15
21
+ rev: 0.5.29
22
22
  hooks:
23
23
  # Run the pip compile
24
24
  - id: pip-compile
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hdx-python-scraper
3
- Version: 2.5.8
3
+ Version: 2.6.0
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>
@@ -95,7 +95,7 @@ run = """
95
95
  """
96
96
 
97
97
  [tool.hatch.envs.hatch-static-analysis]
98
- dependencies = ["ruff==0.8.6"]
98
+ dependencies = ["ruff==0.9.6"]
99
99
 
100
100
  [tool.hatch.envs.hatch-static-analysis.scripts]
101
101
  format-check = ["ruff format --config .config/ruff.toml --check --diff {args:.}",]
@@ -22,7 +22,7 @@ ckanapi==4.8
22
22
  # via hdx-python-api
23
23
  click==8.1.8
24
24
  # via typer
25
- coverage==7.6.10
25
+ coverage==7.6.12
26
26
  # via pytest-cov
27
27
  defopt==6.4.0
28
28
  # via hdx-python-api
@@ -65,7 +65,7 @@ hdx-python-utilities==3.8.3
65
65
  # hdx-python-country
66
66
  humanize==4.11.0
67
67
  # via frictionless
68
- identify==2.6.6
68
+ identify==2.6.7
69
69
  # via pre-commit
70
70
  idna==3.10
71
71
  # via
@@ -113,7 +113,7 @@ nodeenv==1.9.1
113
113
  # via pre-commit
114
114
  num2words==0.5.14
115
115
  # via quantulum3
116
- numpy==2.2.2
116
+ numpy==2.2.3
117
117
  # via pandas
118
118
  oauthlib==3.2.2
119
119
  # via requests-oauthlib
@@ -264,7 +264,7 @@ urllib3==2.3.0
264
264
  # requests
265
265
  validators==0.34.0
266
266
  # via frictionless
267
- virtualenv==20.29.1
267
+ virtualenv==20.29.2
268
268
  # via pre-commit
269
269
  wheel==0.45.1
270
270
  # via libhxl
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '2.5.8'
16
- __version_tuple__ = version_tuple = (2, 5, 8)
15
+ __version__ = version = '2.6.0'
16
+ __version_tuple__ = version_tuple = (2, 6, 0)
@@ -215,7 +215,7 @@ class JsonFile(BaseOutput):
215
215
  if tab not in remove:
216
216
  tabs.append({"tab": tab})
217
217
  for tabdetails in tabs:
218
- key = f'{tabdetails["tab"]}{self.suffix}'
218
+ key = f"{tabdetails['tab']}{self.suffix}"
219
219
  newjson = self.json.get(key)
220
220
  filters = tabdetails.get("filters", {})
221
221
  hxltags = tabdetails.get("output")
@@ -0,0 +1,75 @@
1
+ from typing import List, Tuple
2
+
3
+ from hdx.location.adminlevel import AdminLevel
4
+
5
+
6
+ def complete_admins(
7
+ admins: List[AdminLevel],
8
+ countryiso3: str,
9
+ provider_adm_names: List,
10
+ adm_codes: List,
11
+ adm_names: List,
12
+ ) -> Tuple[int, List[str]]:
13
+ warnings = []
14
+ parent = None
15
+ adm_level = len(provider_adm_names)
16
+ for i, provider_adm_name in reversed(list(enumerate(provider_adm_names))):
17
+ adm_code = adm_codes[i]
18
+ if not provider_adm_name:
19
+ provider_adm_name = ""
20
+ provider_adm_names[i] = ""
21
+ if parent:
22
+ pcode = admins[i + 1].pcode_to_parent.get(parent)
23
+ warntxt = "parent"
24
+ elif provider_adm_name:
25
+ pcode, _ = admins[i].get_pcode(
26
+ countryiso3, provider_adm_name, parent=parent
27
+ )
28
+ warntxt = f"provider_adm{i + 1}_name"
29
+ else:
30
+ pcode = None
31
+ if adm_code:
32
+ if adm_code not in admins[i].pcodes:
33
+ if pcode:
34
+ warnings.append(
35
+ f"PCode unknown {adm_code}->{pcode} ({warntxt})"
36
+ )
37
+ adm_code = pcode
38
+ else:
39
+ warnings.append(f"PCode unknown {adm_code}->''")
40
+ adm_code = ""
41
+ elif pcode and adm_code != pcode:
42
+ if parent:
43
+ warnings.append(
44
+ f"PCode mismatch {adm_code}->{pcode} ({warntxt})"
45
+ )
46
+ adm_code = pcode
47
+ else:
48
+ warnings.append(
49
+ f"PCode mismatch {adm_code} != {provider_adm_name}"
50
+ )
51
+ elif pcode:
52
+ adm_code = pcode
53
+ else:
54
+ adm_code = ""
55
+ adm_codes[i] = adm_code
56
+ if adm_code:
57
+ adm_names[i] = admins[i].pcode_to_name.get(adm_code, "")
58
+ parent = adm_code
59
+ else:
60
+ adm_names[i] = ""
61
+ if provider_adm_name == "":
62
+ adm_level -= 1
63
+ return adm_level, warnings
64
+
65
+
66
+ def pad_admins(
67
+ provider_adm_names: List[str],
68
+ adm_codes: List[str],
69
+ adm_names: List[str],
70
+ adm_level: int = 2,
71
+ ) -> None:
72
+ for i in range(len(provider_adm_names), adm_level):
73
+ provider_adm_names.append("")
74
+ adm_codes.append("")
75
+ adm_names.append("")
@@ -60,5 +60,10 @@ class Lookup:
60
60
  unmatched=self._unmatched,
61
61
  )
62
62
 
63
+ def get_name(
64
+ self, code: str, default: Optional[str] = None
65
+ ) -> Optional[str]:
66
+ return self._code_to_name.get(code, default)
67
+
63
68
  def get_code_to_name(self) -> Dict[str, str]:
64
69
  return self._code_to_name
@@ -0,0 +1,158 @@
1
+ Location,Country Length,Admin 1 Length,Admin 2 Length,Admin 3 Length,Admin 4 Length,Admin 5 Length
2
+ #country+code,#country+len,#adm1+len,#adm2+len,#adm3+len,#adm4+len,#adm5+len
3
+ AFG,2,2,2,,,
4
+ AGO,2,2,3,3,,
5
+ ALB,2,2,2,2,,
6
+ ARE,2,2,,,,
7
+ ARG,2,3,3,,,
8
+ ARM,2,2,1,3,,
9
+ ATG,2,2,,,,
10
+ AZE,2,8,,,,
11
+ BDI,3,3,3,,,
12
+ BEN,2,2,2,,,
13
+ BES,3,1,,,,
14
+ BFA,2,2,2,2,,
15
+ BGD,2,2,2,2,2,
16
+ BGR,2,3,3,,,
17
+ BLR,2,3,3,,,
18
+ BLZ,2,2,,,,
19
+ BMU,2,2,1,,,
20
+ BOL,2,2,2,2,,
21
+ B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+ TLS,2,2,2,2,,
140
+ TON,2,1,1,2,,
141
+ TTO,2,2,,,,
142
+ TUN,2,1,1,2,2,
143
+ TUR,3,3,3,3,3,
144
+ TZA,2,2,2,3|4,,
145
+ UGA,2,1,3,2,2,
146
+ UKR,2,2,2,3,3,
147
+ URY,2,2,3,,,
148
+ UZB,2,2,3,,,
149
+ VCT,2,1,2,,,
150
+ VEN,2,2,2,2,,
151
+ VGB,2,2,,,,
152
+ VIR,2,3,5,,,
153
+ VNM,2,3,2,,,
154
+ VUT,2,2,3,,,
155
+ YEM,2,2,2,2,,
156
+ ZAF,2,1,2,1,3,
157
+ ZMB,2,3,3,3,3,
158
+ ZWE,2,2,2,2,,