Skip to content

Commit

Permalink
wip use official iati codelists
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjwebb committed Dec 6, 2024
1 parent 7f4f35f commit d3b12cb
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/end_to_end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
./get_codelist_mapping.sh
./get_codelists.sh
./get_schemas.sh
wget -q "https://raw.githubusercontent.com/codeforIATI/IATI-Dashboard/main/registry_id_relationships.csv"
wget -q "https://raw.githubusercontent.com/IATI/IATI-Dashboard/main/registry_id_relationships.csv"
wget -q https://codeforiati.org/imf-exchangerates/imf_exchangerates_A_ENDA_USD.csv -O currency_conversion/exchange_rates.csv
cd ..
- name: Symlink fixtures for IATI data
Expand Down
2 changes: 1 addition & 1 deletion git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ echo "LOG: `date '+%Y-%m-%d %H:%M:%S'` - Update codelists"
echo "LOG: `date '+%Y-%m-%d %H:%M:%S'` - Update schemas"
./get_schemas.sh

wget -q https://raw.githubusercontent.com/codeforIATI/IATI-Dashboard/main/registry_id_relationships.csv
wget -q https://raw.githubusercontent.com/IATI/IATI-Dashboard/main/registry_id_relationships.csv
wget -q https://codeforiati.org/imf-exchangerates/imf_exchangerates_A_ENDA_USD.csv -O currency_conversion/exchange_rates.csv

# Build a JSON file of metadata for each CKAN publisher, and for each dataset published.
Expand Down
9 changes: 5 additions & 4 deletions helpers/get_codelist_mapping.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env bash

wget --tries=20 --waitretry=10 --retry-connrefused https://raw.github.com/codeforIATI/IATI-Codelists/version-1.05/mapping.xml -O mapping-1.xml
wget --tries=20 --waitretry=10 --retry-connrefused https://raw.githubusercontent.com/IATI/IATI-Codelists/refs/heads/version-1.05/mapping.xml -O mapping-1.xml
python mappings_to_json.py mapping-1.xml > mapping-1.json

wget --tries=20 --waitretry=10 --retry-connrefused https://raw.github.com/codeforIATI/IATI-Codelists/version-2.03/mapping.xml -O mapping-2.xml
wget --tries=20 --waitretry=10 --retry-connrefused https://raw.github.com/codeforIATI/Unofficial-Codelists/master/mapping.xml -O mapping-unofficial.xml
python mappings_to_json.py mapping-2.xml mapping-unofficial.xml > mapping-2.json
wget --tries=20 --waitretry=10 --retry-connrefused https://raw.githubusercontent.com/IATI/IATI-Codelists/refs/heads/version-2.03/mapping.xml -O mapping-2.xml
python mappings_to_json.py mapping-2.xml > mapping-2.json
# wget --tries=20 --waitretry=10 --retry-connrefused https://raw.github.com/codeforIATI/Unofficial-Codelists/master/mapping.xml -O mapping-unofficial.xml
# python mappings_to_json.py mapping-2.xml mapping-unofficial.xml > mapping-2.json
40 changes: 20 additions & 20 deletions helpers/get_codelists.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
#!/usr/bin/env bash

mkdir -p codelists/1
wget --tries=20 --waitretry=10 --retry-connrefused "https://codelists.codeforiati.org/api/1/json/en/Version.json" -O codelists/1/Version.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://codelists.codeforiati.org/api/1/json/en/ActivityStatus.json" -O codelists/1/ActivityStatus.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://codelists.codeforiati.org/api/1/json/en/Currency.json" -O codelists/1/Currency.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://codelists.codeforiati.org/api/1/json/en/Sector.json" -O codelists/1/Sector.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://codelists.codeforiati.org/api/1/json/en/SectorCategory.json" -O codelists/1/SectorCategory.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://codelists.codeforiati.org/api/1/json/en/DocumentCategory.json" -O codelists/1/DocumentCategory.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://codelists.codeforiati.org/api/1/json/en/AidType.json" -O codelists/1/AidType.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://codelists.codeforiati.org/api/1/json/en/BudgetNotProvided.json" -O codelists/1/BudgetNotProvided.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://codelists.codeforiati.org/api/1/json/en/OrganisationRegistrationAgency.json" -O codelists/1/OrganisationRegistrationAgency.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://codelists.codeforiati.org/api/1/json/en/CRSChannelCode.json" -O codelists/1/CRSChannelCode.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://iatistandard.org/reference_downloads/105/codelists/downloads/clv3/json/en/Version.json" -O codelists/1/Version.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://iatistandard.org/reference_downloads/105/codelists/downloads/clv3/json/en/ActivityStatus.json" -O codelists/1/ActivityStatus.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://iatistandard.org/reference_downloads/105/codelists/downloads/clv3/json/en/Currency.json" -O codelists/1/Currency.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://iatistandard.org/reference_downloads/105/codelists/downloads/clv3/json/en/Sector.json" -O codelists/1/Sector.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://iatistandard.org/reference_downloads/105/codelists/downloads/clv3/json/en/SectorCategory.json" -O codelists/1/SectorCategory.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://iatistandard.org/reference_downloads/105/codelists/downloads/clv3/json/en/DocumentCategory.json" -O codelists/1/DocumentCategory.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://iatistandard.org/reference_downloads/105/codelists/downloads/clv3/json/en/AidType.json" -O codelists/1/AidType.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://iatistandard.org/reference_downloads/105/codelists/downloads/clv3/json/en/BudgetNotProvided.json" -O codelists/1/BudgetNotProvided.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://iatistandard.org/reference_downloads/105/codelists/downloads/clv3/json/en/OrganisationRegistrationAgency.json" -O codelists/1/OrganisationRegistrationAgency.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://iatistandard.org/reference_downloads/105/codelists/downloads/clv3/json/en/CRSChannelCode.json" -O codelists/1/CRSChannelCode.json

mkdir -p codelists/2
wget --tries=20 --waitretry=10 --retry-connrefused "https://codelists.codeforiati.org/api/json/en/Version.json" -O codelists/2/Version.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://codelists.codeforiati.org/api/json/en/ActivityStatus.json" -O codelists/2/ActivityStatus.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://codelists.codeforiati.org/api/json/en/Currency.json" -O codelists/2/Currency.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://codelists.codeforiati.org/api/json/en/Sector.json" -O codelists/2/Sector.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://codelists.codeforiati.org/api/json/en/SectorCategory.json" -O codelists/2/SectorCategory.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://codelists.codeforiati.org/api/json/en/DocumentCategory.json" -O codelists/2/DocumentCategory.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://codelists.codeforiati.org/api/json/en/AidType.json" -O codelists/2/AidType.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://codelists.codeforiati.org/api/json/en/BudgetNotProvided.json" -O codelists/2/BudgetNotProvided.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://codelists.codeforiati.org/api/json/en/OrganisationRegistrationAgency.json" -O codelists/2/OrganisationRegistrationAgency.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://codelists.codeforiati.org/api/json/en/CRSChannelCode.json" -O codelists/2/CRSChannelCode.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://iatistandard.org/reference_downloads/203/codelists/downloads/clv3/json/en/Version.json" -O codelists/2/Version.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://iatistandard.org/reference_downloads/203/codelists/downloads/clv3/json/en/ActivityStatus.json" -O codelists/2/ActivityStatus.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://iatistandard.org/reference_downloads/203/codelists/downloads/clv3/json/en/Currency.json" -O codelists/2/Currency.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://iatistandard.org/reference_downloads/203/codelists/downloads/clv3/json/en/Sector.json" -O codelists/2/Sector.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://iatistandard.org/reference_downloads/203/codelists/downloads/clv3/json/en/SectorCategory.json" -O codelists/2/SectorCategory.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://iatistandard.org/reference_downloads/203/codelists/downloads/clv3/json/en/DocumentCategory.json" -O codelists/2/DocumentCategory.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://iatistandard.org/reference_downloads/203/codelists/downloads/clv3/json/en/AidType.json" -O codelists/2/AidType.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://iatistandard.org/reference_downloads/203/codelists/downloads/clv3/json/en/BudgetNotProvided.json" -O codelists/2/BudgetNotProvided.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://iatistandard.org/reference_downloads/203/codelists/downloads/clv3/json/en/OrganisationRegistrationAgency.json" -O codelists/2/OrganisationRegistrationAgency.json
wget --tries=20 --waitretry=10 --retry-connrefused "https://iatistandard.org/reference_downloads/203/codelists/downloads/clv3/json/en/CRSChannelCode.json" -O codelists/2/CRSChannelCode.json

0 comments on commit d3b12cb

Please sign in to comment.