About Openaid.se and openaid_se gem
Openaid.se is a website by the Swedish Ministry for Foreign Affairs and SIDA (Swedish International Development Cooperation Agency) that lets people see how Swedish aid is being distributed around the world. The data on the site is also available through an API which this gem aims to help in accessing.
Some code examples
# Find all contributions contributions = OpenaidSe::Contribution.all # Find contributions by sector contributions = OpenaidSe::Contribution.find_by_sector(4) # Find contributions by year contributions = OpenaidSe::Contribution.find_by_year(2002) # Find contributions by sector and year contributions = OpenaidSe::Contribution.find_by_sector_and_year(4, 2002) # You can add the params you need contributions = OpenaidSe::Contribution.find_by_sector_and_year_and_country(4, 2002, 1) # Find a specific contribution contribution = OpenaidSe::Contribution.find_by_id(10472) contribution.name contribution.country contribution.delivery_channel contribution.documents contribution.partner_organization contribution.sector contribution.subsector
# Find all countries countries = OpenaidSe::Country.all # Find a specific country country = OpenaidSe::Country.find_by_id(1) country.name country.documents country.contributions
# Find all delivery channels delivery_channels = OpenaidSe::DeliveryChannel.all # Find a specific delivery channel delivery_channel = OpenaidSe::DeliveryChannel.find_by_id(40000) delivery_channel.name delivery_channel.contributions
# Find all documents documents = OpenaidSe::Document.all # Find a specific document document = OpenaidSe::Document.find_by_id(52028) document.title document.url
# Find all partner organizations partner_organizations = OpenaidSe::PartnerOrganization.all # Find a specific partner organization partner_organization = OpenaidSe::PartnerOrganization.find_by_id(1958) partner_organization.name partner_organization.contributions partner_organization.documents
# Find all sectors sectors = OpenaidSe::Sector.all # Find a specific sector sector = OpenaidSe::Sector.find_by_id(1) sector.name sector.contributions sector.documents sector.subsectors
# Find all subsectors subsectors = OpenaidSe::Subsector.all # Find a specific subsector subsector = OpenaidSe::Subsector.find_by_id(12220) subsector.name subsector.contributions subsector.documents subsector.sector
# Find all DAC official_dac = OpenaidSe::OfficialDac.all # Find DAC by year official_dac = OpenaidSe::OfficialDac.find_by_year(2008) official_dac.year official_dac.sum official_dac.bilateral official_dac.multilateral
Please go ahead and fork the project if you like it. Any help with writing tests would be great!