worldbank_as_dataframe 0.1.0

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 (62) hide show
  1. checksums.yaml +7 -0
  2. data/.autotest +1 -0
  3. data/.gemtest +0 -0
  4. data/.gitignore +42 -0
  5. data/.rspec +3 -0
  6. data/.ruby-gemset +1 -0
  7. data/.ruby-version +1 -0
  8. data/.travis.yml +5 -0
  9. data/.yardopts +3 -0
  10. data/Changelog +6 -0
  11. data/Gemfile +4 -0
  12. data/LICENSE.md +10 -0
  13. data/README.md +164 -0
  14. data/Rakefile +16 -0
  15. data/bin/console +15 -0
  16. data/bin/setup +8 -0
  17. data/lib/worldbank_as_dataframe/client.rb +69 -0
  18. data/lib/worldbank_as_dataframe/country.rb +326 -0
  19. data/lib/worldbank_as_dataframe/data.rb +47 -0
  20. data/lib/worldbank_as_dataframe/data_query.rb +82 -0
  21. data/lib/worldbank_as_dataframe/income_level.rb +23 -0
  22. data/lib/worldbank_as_dataframe/indicator.rb +42 -0
  23. data/lib/worldbank_as_dataframe/lending_type.rb +23 -0
  24. data/lib/worldbank_as_dataframe/param_query.rb +51 -0
  25. data/lib/worldbank_as_dataframe/queriable.rb +39 -0
  26. data/lib/worldbank_as_dataframe/query.rb +213 -0
  27. data/lib/worldbank_as_dataframe/region.rb +22 -0
  28. data/lib/worldbank_as_dataframe/source.rb +25 -0
  29. data/lib/worldbank_as_dataframe/topic.rb +25 -0
  30. data/lib/worldbank_as_dataframe/version.rb +3 -0
  31. data/lib/worldbank_as_dataframe.rb +21 -0
  32. data/spec/fixtures/brazil.json +43 -0
  33. data/spec/fixtures/countries.json +2 -0
  34. data/spec/fixtures/countries_india.json +2 -0
  35. data/spec/fixtures/income_level_lmc.json +1 -0
  36. data/spec/fixtures/income_levels.json +2 -0
  37. data/spec/fixtures/indicators.json +2 -0
  38. data/spec/fixtures/indicators_tractors.json +1 -0
  39. data/spec/fixtures/lending_type_idb.json +1 -0
  40. data/spec/fixtures/lending_types.json +1 -0
  41. data/spec/fixtures/regions.json +2 -0
  42. data/spec/fixtures/regions_world.json +1 -0
  43. data/spec/fixtures/source_21.json +2 -0
  44. data/spec/fixtures/sources.json +1 -0
  45. data/spec/fixtures/topic_6.json +2 -0
  46. data/spec/fixtures/topics.json +2 -0
  47. data/spec/helper.rb +48 -0
  48. data/spec/worldbank_as_dataframe/client_spec.rb +23 -0
  49. data/spec/worldbank_as_dataframe/country_spec.rb +35 -0
  50. data/spec/worldbank_as_dataframe/data_query_spec.rb +38 -0
  51. data/spec/worldbank_as_dataframe/data_spec.rb +26 -0
  52. data/spec/worldbank_as_dataframe/income_level_spec.rb +26 -0
  53. data/spec/worldbank_as_dataframe/indicator_spec.rb +38 -0
  54. data/spec/worldbank_as_dataframe/lending_type_spec.rb +26 -0
  55. data/spec/worldbank_as_dataframe/param_query_spec.rb +45 -0
  56. data/spec/worldbank_as_dataframe/query_spec.rb +83 -0
  57. data/spec/worldbank_as_dataframe/region_spec.rb +29 -0
  58. data/spec/worldbank_as_dataframe/source_spec.rb +32 -0
  59. data/spec/worldbank_as_dataframe/topic_spec.rb +35 -0
  60. data/spec/worldbank_as_dataframe_spec.rb +9 -0
  61. data/worldbank_as_dataframe.gemspec +30 -0
  62. metadata +274 -0
@@ -0,0 +1,213 @@
1
+ module WorldbankAsDataframe
2
+
3
+ class Query
4
+
5
+ attr_reader :pages, :total
6
+
7
+ def initialize(name, id, model)
8
+ @model = model
9
+ @name = name
10
+ @id = id
11
+ @lang = false
12
+ @raw = false
13
+ @new = true
14
+ @query = {:params => {:format => :json}, :dirs => []}
15
+ @param_dir = []
16
+ end
17
+
18
+ #
19
+ # the date param is expressed as a range 'StartDate:EndDate'
20
+ # Date may be year & month, year & quarter, or just year
21
+ # Date will convert any Date/Time object to an apporpriate year & month
22
+ #
23
+ def dates(date_range)
24
+ if date_range.is_a? String
25
+
26
+ # assume the user knows what she is doing if passed a string
27
+ @query[:params][:date] = date_range
28
+ elsif date_range.is_a? Range
29
+ start = date_range.first
30
+ last = date_range.last
31
+ @query[:params][:date] = "#{start.strftime("%YM%m")}:#{last.strftime("%YM%m")}"
32
+ end
33
+ self
34
+ end
35
+
36
+ def format(format)
37
+ @query[:params][:format] = format
38
+ self
39
+ end
40
+
41
+ def raw
42
+ @raw = true
43
+ self
44
+ end
45
+
46
+ def id(id)
47
+ @query[:params][:id] = id
48
+ self
49
+ end
50
+
51
+ #
52
+ # Most Recent Values param has two optional params
53
+ # Gap fill will specify how many items to add if there isn't enough data for you query
54
+ # Frequency sets how frequent the data sets are...
55
+ # An example is best to explain this:
56
+ # I want the 5 most recent yearly values between 2000 and 2010,
57
+ # but I need at least three data sets to continue. My query would look like this:
58
+ # .dates('2000:2010').most_recent_values(:gap_fill => 3, :frequency => 'Y')
59
+ #
60
+ def most_recent_values(num, options={})
61
+ @query[:params][:gapFill] = options[:gap_fill] if options[:gap_fill]
62
+ @query[:params][:frequency] = options[:frequency] if options[:frequency]
63
+ @query[:params][:MRV] = num
64
+ self
65
+ end
66
+
67
+ def per_page(num=false)
68
+ if num
69
+ @query[:params][:per_page] = num
70
+ self
71
+ else
72
+ @per_page || @query[:params][:per_page] || 50
73
+ end
74
+ end
75
+
76
+ def page(num=false)
77
+ if num
78
+ @query[:params][:page] = num
79
+ self
80
+ else
81
+ @page || @query[:params][:page] || 1
82
+ end
83
+ end
84
+
85
+ def next
86
+ if @query[:params][:page].nil?
87
+ @query[:params][:page] = 2
88
+ else
89
+ @query[:params][:page] += 1
90
+ end
91
+ self
92
+ end
93
+
94
+ def language(lang)
95
+ if lang.to_s.length == 2
96
+ @lang = lang.to_s.downcase
97
+ else
98
+ @lang = [ ['french', 'fr'],
99
+ ['spanish', 'es'],
100
+ ['english', 'en'],
101
+ ['arabic', 'ar'] ].assoc(lang.to_s.downcase)[1]
102
+ end
103
+ self
104
+ end
105
+
106
+ def cycle
107
+ @cycle_results = @pages.nil? ? fetch : []
108
+ (@pages - self.page).times do
109
+ @cycle_results += self.next.fetch
110
+ end
111
+ @cycle_results
112
+ end
113
+
114
+ def fetch
115
+ if @new
116
+ @query[:dirs].push @name
117
+ @query[:dirs].push @id
118
+ @query[:dirs].unshift @lang if @lang
119
+ @query[:params][:format] ||= :json
120
+ @new = false
121
+ end
122
+ @query[:dirs] = @param_dir + @query[:dirs] unless @param_dir.empty?
123
+ client = WorldbankAsDataframe::Client.new(@query, @raw)
124
+ results = client.get_query
125
+
126
+ results = parse results unless (results.nil? || @raw)
127
+
128
+ results.nil? ? nil : results
129
+ end
130
+
131
+ protected
132
+
133
+ def parse(results)
134
+ update_fetch_info(results[0])
135
+ if @id =~ /all/ || @model == WorldbankAsDataframe::Data
136
+ results = results[1].map { |result| @model.new result }
137
+ else
138
+ results = @model.new results[1][0]
139
+ end
140
+ results
141
+ end
142
+
143
+ def update_fetch_info(meta_info)
144
+ @page = meta_info['page'].to_i
145
+ @per_page = meta_info['per_page'].to_i
146
+ @pages = meta_info['pages'].to_i
147
+ @total = meta_info['total'].to_i
148
+ end
149
+
150
+ def indifferent_number(possibly_multiple_args)
151
+ parsed = if possibly_multiple_args.is_a?(Array)
152
+ arr = possibly_multiple_args.map do |arg|
153
+ indifferent_type(arg)
154
+ end
155
+ arr.join(';')
156
+ else
157
+ indifferent_type(possibly_multiple_args)
158
+ end
159
+ parsed
160
+ end
161
+
162
+ def indifferent_type(arg)
163
+ parsed = ''
164
+ unless arg.is_a?(String) || arg.is_a?(Numeric)
165
+ parsed = arg.id
166
+ else
167
+ parsed = arg
168
+ end
169
+ parsed
170
+ end
171
+
172
+ def ensure_country_id(id)
173
+ @country_id = id
174
+ if @country_id.length > 3
175
+ @matching = WorldbankAsDataframe::Country.country_aliases.select do |country|
176
+ country[2] =~ Regexp.new(@country_id)
177
+ end
178
+ if @matching.length > 1
179
+ raise ArgumentError,
180
+ "More than one country code matched '#{@country_id}'. Perhaps you meant one of #{@matching.join(', ')}?",
181
+ caller
182
+ elsif @matching.length == 0
183
+ raise ArgumentError,
184
+ "No countries matched '#{@country_id}', please try again.",
185
+ caller
186
+ else
187
+ @country_id = @matching[0][0]
188
+ end
189
+ end
190
+ @country_id
191
+ end
192
+
193
+ def indifferent_nums(args)
194
+ parsed = ''
195
+ if args.is_a? Array
196
+ parsed = args.map! do |arg|
197
+ arg = normalize_country_id arg
198
+ arg = ensure_country_id arg
199
+ end.join(';')
200
+ else
201
+ args = normalize_country_id args
202
+ parsed = ensure_country_id args
203
+ end
204
+ parsed
205
+ end
206
+
207
+ def normalize_country_id(id)
208
+ id.gsub!(/[ -]/, '_')
209
+ id.downcase
210
+ end
211
+ end
212
+ end
213
+
@@ -0,0 +1,22 @@
1
+ module WorldbankAsDataframe
2
+ class Region
3
+
4
+ attr_reader :raw, :id, :name, :code, :type
5
+
6
+ def self.all
7
+ find('all')
8
+ end
9
+
10
+ def self.find(id)
11
+ WorldbankAsDataframe::ParamQuery.new('regions', id, self)
12
+ end
13
+
14
+ def initialize(values={})
15
+ @raw = values
16
+ @id = values['id']
17
+ @code = values['code']
18
+ @name = values['name']
19
+ @type = 'regions'
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,25 @@
1
+ module WorldbankAsDataframe
2
+
3
+ class Source
4
+
5
+ attr_reader :raw, :id, :name, :description, :url, :type
6
+
7
+ def self.all
8
+ find('all')
9
+ end
10
+
11
+ def self.find(id)
12
+ WorldbankAsDataframe::ParamQuery.new('sources', id, self)
13
+ end
14
+
15
+ def initialize(values={})
16
+ @raw = values
17
+ @id = values['id']
18
+ @name = values['name']
19
+ @description = values['description']
20
+ @url = values['url']
21
+ @type = 'sources'
22
+ end
23
+ end
24
+
25
+ end
@@ -0,0 +1,25 @@
1
+ module WorldbankAsDataframe
2
+
3
+ class Topic
4
+
5
+ attr_reader :raw, :id, :name, :note, :type
6
+
7
+ def self.all
8
+ find('all')
9
+ end
10
+
11
+ def self.find(id)
12
+ WorldbankAsDataframe::ParamQuery.new('topics', id, self)
13
+ end
14
+
15
+ def initialize(values={})
16
+ @raw = values
17
+ @id = values['id']
18
+ @name = values['value']
19
+ @note = values['sourceNote']
20
+ @type = 'topics'
21
+ end
22
+
23
+ end
24
+
25
+ end
@@ -0,0 +1,3 @@
1
+ module WorldbankAsDataframe
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,21 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), '/worldbank_as_dataframe/client'))
2
+
3
+ module WorldbankAsDataframe
4
+
5
+ def self.client(query={}, raw=false)
6
+ defaults = {:params => {:format => :json}, :dirs => []}
7
+ defaults.merge!(query)
8
+ WorldbankAsDataframe::Client.new(defaults, raw)
9
+ end
10
+
11
+ # Delegate to WorldbankAsDataframe::Client.new
12
+ def self.method_missing(method, *args, &block)
13
+ return super unless client.respond_to?(method)
14
+ client.send(method, *args, &block)
15
+ end
16
+
17
+ def self.respond_to?(method, include_private=false)
18
+ client.respond_to?(method, include_private) || super(method, include_private)
19
+ end
20
+
21
+ end
@@ -0,0 +1,43 @@
1
+ [
2
+
3
+ -
4
+ {
5
+ page: 1
6
+ pages: 1
7
+ per_page: "50"
8
+ total: 1
9
+ }
10
+ -
11
+ [
12
+ -
13
+ {
14
+ id: "BRA"
15
+ iso2Code: "BR"
16
+ name: "Brazil"
17
+ -
18
+ region: {
19
+ id: "LCN"
20
+ value: "Latin America & Caribbean (all income levels)"
21
+ }
22
+ -
23
+ adminregion: {
24
+ id: "LAC"
25
+ value: "Latin America & Caribbean (developing only)"
26
+ }
27
+ -
28
+ incomeLevel: {
29
+ id: "UMC"
30
+ value: "Upper middle income"
31
+ }
32
+ -
33
+ lendingType: {
34
+ id: "IBD"
35
+ value: "IBRD"
36
+ }
37
+ capitalCity: "Brasilia"
38
+ longitude: "-47.9292"
39
+ latitude: "-15.7801"
40
+ }
41
+ ]
42
+
43
+ ]
@@ -0,0 +1,2 @@
1
+ [{"page":1,"pages":5,"per_page":"50","total":240},[{"id":"ABW","iso2Code":"AW","name":"Aruba","region":{"id":"LCN","value":"Latin America & Caribbean (all income levels)"},"adminregion":{"id":"","value":""},"incomeLevel":{"id":"NOC","value":"High income: nonOECD"},"lendingType":{"id":"NC","value":"Not classified"},"capitalCity":"Oranjestad","longitude":"-70.0167","latitude":"12.5167"},{"id":"AFG","iso2Code":"AF","name":"Afghanistan","region":{"id":"SAS","value":"South Asia"},"adminregion":{"id":"SAS","value":"South Asia"},"incomeLevel":{"id":"LIC","value":"Low income"},"lendingType":{"id":"IDX","value":"IDA"},"capitalCity":"Kabul","longitude":"69.1761","latitude":"34.5228"},{"id":"AGO","iso2Code":"AO","name":"Angola","region":{"id":"SSF","value":"Sub-Saharan Africa (all income levels)"},"adminregion":{"id":"SSA","value":"Sub-Saharan Africa (developing only)"},"incomeLevel":{"id":"LMC","value":"Lower middle income"},"lendingType":{"id":"IDX","value":"IDA"},"capitalCity":"Luanda","longitude":"13.242","latitude":"-8.81155"},{"id":"ALB","iso2Code":"AL","name":"Albania","region":{"id":"ECS","value":"Europe & Central Asia (all income levels)"},"adminregion":{"id":"ECA","value":"Europe & Central Asia (developing only)"},"incomeLevel":{"id":"UMC","value":"Upper middle income"},"lendingType":{"id":"IBD","value":"IBRD"},"capitalCity":"Tirane","longitude":"19.8172","latitude":"41.3317"},{"id":"AND","iso2Code":"AD","name":"Andorra","region":{"id":"ECS","value":"Europe & Central Asia (all income levels)"},"adminregion":{"id":"","value":""},"incomeLevel":{"id":"NOC","value":"High income: nonOECD"},"lendingType":{"id":"NC","value":"Not classified"},"capitalCity":"Andorra la Vella","longitude":"1.5218","latitude":"42.5075"},{"id":"ANT","iso2Code":"AN","name":"Netherlands Antilles","region":{"id":"LCN","value":"Latin America & Caribbean (all income levels)"},"adminregion":{"id":"","value":""},"incomeLevel":{"id":"NOC","value":"High income: nonOECD"},"lendingType":{"id":"NC","value":"Not classified"},"capitalCity":"Willemstad","longitude":"-68.9335","latitude":"12.1034"},{"id":"ARB","iso2Code":"1A","name":"Arab World","region":{"id":"NA","value":"Aggregates"},"adminregion":{"id":"","value":""},"incomeLevel":{"id":"NA","value":"Aggregates"},"lendingType":{"id":"","value":"Aggregates"},"capitalCity":"","longitude":"","latitude":""},{"id":"ARE","iso2Code":"AE","name":"United Arab Emirates","region":{"id":"MEA","value":"Middle East & North Africa (all income levels)"},"adminregion":{"id":"","value":""},"incomeLevel":{"id":"NOC","value":"High income: nonOECD"},"lendingType":{"id":"NC","value":"Not classified"},"capitalCity":"Abu Dhabi","longitude":"54.3705","latitude":"24.4764"},{"id":"ARG","iso2Code":"AR","name":"Argentina","region":{"id":"LCN","value":"Latin America & Caribbean (all income levels)"},"adminregion":{"id":"LAC","value":"Latin America & Caribbean (developing only)"},"incomeLevel":{"id":"UMC","value":"Upper middle income"},"lendingType":{"id":"IBD","value":"IBRD"},"capitalCity":"Buenos Aires","longitude":"-58.4173","latitude":"-34.6118"},{"id":"ARM","iso2Code":"AM","name":"Armenia","region":{"id":"ECS","value":"Europe & Central Asia (all income levels)"},"adminregion":{"id":"ECA","value":"Europe & Central Asia (developing only)"},"incomeLevel":{"id":"LMC","value":"Lower middle income"},"lendingType":{"id":"IDB","value":"Blend"},"capitalCity":"Yerevan","longitude":"44.509","latitude":"40.1596"},{"id":"ASM","iso2Code":"AS","name":"American Samoa","region":{"id":"EAS","value":"East Asia & Pacific (all income levels)"},"adminregion":{"id":"EAP","value":"East Asia & Pacific (developing only)"},"incomeLevel":{"id":"UMC","value":"Upper middle income"},"lendingType":{"id":"NC","value":"Not classified"},"capitalCity":"Pago Pago","longitude":"-170.691","latitude":"-14.2846"},{"id":"ATG","iso2Code":"AG","name":"Antigua and Barbuda","region":{"id":"LCN","value":"Latin America & Caribbean (all income levels)"},"adminregion":{"id":"LAC","value":"Latin America & Caribbean (developing only)"},"incomeLevel":{"id":"UMC","value":"Upper middle income"},"lendingType":{"id":"IBD","value":"IBRD"},"capitalCity":"Saint John's","longitude":"-61.8456","latitude":"17.1175"},{"id":"AUS","iso2Code":"AU","name":"Australia","region":{"id":"EAS","value":"East Asia & Pacific (all income levels)"},"adminregion":{"id":"","value":""},"incomeLevel":{"id":"OEC","value":"High income: OECD"},"lendingType":{"id":"NC","value":"Not classified"},"capitalCity":"Canberra","longitude":"149.129","latitude":"-35.282"},{"id":"AUT","iso2Code":"AT","name":"Austria","region":{"id":"ECS","value":"Europe & Central Asia (all income levels)"},"adminregion":{"id":"","value":""},"incomeLevel":{"id":"OEC","value":"High income: OECD"},"lendingType":{"id":"NC","value":"Not classified"},"capitalCity":"Vienna","longitude":"16.3798","latitude":"48.2201"},{"id":"AZE","iso2Code":"AZ","name":"Azerbaijan","region":{"id":"ECS","value":"Europe & Central Asia (all income levels)"},"adminregion":{"id":"ECA","value":"Europe & Central Asia (developing only)"},"incomeLevel":{"id":"UMC","value":"Upper middle income"},"lendingType":{"id":"IDB","value":"Blend"},"capitalCity":"Baku","longitude":"49.8932","latitude":"40.3834"},{"id":"BDI","iso2Code":"BI","name":"Burundi","region":{"id":"SSF","value":"Sub-Saharan Africa (all income levels)"},"adminregion":{"id":"SSA","value":"Sub-Saharan Africa (developing only)"},"incomeLevel":{"id":"LIC","value":"Low income"},"lendingType":{"id":"IDX","value":"IDA"},"capitalCity":"Bujumbura","longitude":"29.3639","latitude":"-3.3784"},{"id":"BEL","iso2Code":"BE","name":"Belgium","region":{"id":"ECS","value":"Europe & Central Asia (all income levels)"},"adminregion":{"id":"","value":""},"incomeLevel":{"id":"OEC","value":"High income: OECD"},"lendingType":{"id":"NC","value":"Not classified"},"capitalCity":"Brussels","longitude":"4.36761","latitude":"50.8371"},{"id":"BEN","iso2Code":"BJ","name":"Benin","region":{"id":"SSF","value":"Sub-Saharan Africa (all income levels)"},"adminregion":{"id":"SSA","value":"Sub-Saharan Africa (developing only)"},"incomeLevel":{"id":"LIC","value":"Low income"},"lendingType":{"id":"IDX","value":"IDA"},"capitalCity":"Porto-Novo","longitude":"2.6323","latitude":"6.4779"},{"id":"BFA","iso2Code":"BF","name":"Burkina Faso","region":{"id":"SSF","value":"Sub-Saharan Africa (all income levels)"},"adminregion":{"id":"SSA","value":"Sub-Saharan Africa (developing only)"},"incomeLevel":{"id":"LIC","value":"Low income"},"lendingType":{"id":"IDX","value":"IDA"},"capitalCity":"Ouagadougou","longitude":"-1.53395","latitude":"12.3605"},{"id":"BGD","iso2Code":"BD","name":"Bangladesh","region":{"id":"SAS","value":"South Asia"},"adminregion":{"id":"SAS","value":"South Asia"},"incomeLevel":{"id":"LIC","value":"Low income"},"lendingType":{"id":"IDX","value":"IDA"},"capitalCity":"Dhaka","longitude":"90.4113","latitude":"23.7055"},{"id":"BGR","iso2Code":"BG","name":"Bulgaria","region":{"id":"ECS","value":"Europe & Central Asia (all income levels)"},"adminregion":{"id":"ECA","value":"Europe & Central Asia (developing only)"},"incomeLevel":{"id":"UMC","value":"Upper middle income"},"lendingType":{"id":"IBD","value":"IBRD"},"capitalCity":"Sofia","longitude":"23.3238","latitude":"42.7105"},{"id":"BHR","iso2Code":"BH","name":"Bahrain","region":{"id":"MEA","value":"Middle East & North Africa (all income levels)"},"adminregion":{"id":"","value":""},"incomeLevel":{"id":"NOC","value":"High income: nonOECD"},"lendingType":{"id":"NC","value":"Not classified"},"capitalCity":"Manama","longitude":"50.5354","latitude":"26.1921"},{"id":"BHS","iso2Code":"BS","name":"Bahamas, The","region":{"id":"LCN","value":"Latin America & Caribbean (all income levels)"},"adminregion":{"id":"","value":""},"incomeLevel":{"id":"NOC","value":"High income: nonOECD"},"lendingType":{"id":"NC","value":"Not classified"},"capitalCity":"Nassau","longitude":"-77.339","latitude":"25.0661"},{"id":"BIH","iso2Code":"BA","name":"Bosnia and Herzegovina","region":{"id":"ECS","value":"Europe & Central Asia (all income levels)"},"adminregion":{"id":"ECA","value":"Europe & Central Asia (developing only)"},"incomeLevel":{"id":"UMC","value":"Upper middle income"},"lendingType":{"id":"IDB","value":"Blend"},"capitalCity":"Sarajevo","longitude":"18.4214","latitude":"43.8607"},{"id":"BLR","iso2Code":"BY","name":"Belarus","region":{"id":"ECS","value":"Europe & Central Asia (all income levels)"},"adminregion":{"id":"ECA","value":"Europe & Central Asia (developing only)"},"incomeLevel":{"id":"UMC","value":"Upper middle income"},"lendingType":{"id":"IBD","value":"IBRD"},"capitalCity":"Minsk","longitude":"27.5766","latitude":"53.9678"},{"id":"BLZ","iso2Code":"BZ","name":"Belize","region":{"id":"LCN","value":"Latin America & Caribbean (all income levels)"},"adminregion":{"id":"LAC","value":"Latin America & Caribbean (developing only)"},"incomeLevel":{"id":"LMC","value":"Lower middle income"},"lendingType":{"id":"IBD","value":"IBRD"},"capitalCity":"Belmopan","longitude":"-88.7713","latitude":"17.2534"},{"id":"BMU","iso2Code":"BM","name":"Bermuda","region":{"id":"NAC","value":"North America"},"adminregion":{"id":"","value":""},"incomeLevel":{"id":"NOC","value":"High income: nonOECD"},"lendingType":{"id":"NC","value":"Not classified"},"capitalCity":"Hamilton","longitude":"-64.706","latitude":"32.3293"},{"id":"BOL","iso2Code":"BO","name":"Bolivia","region":{"id":"LCN","value":"Latin America & Caribbean (all income levels)"},"adminregion":{"id":"LAC","value":"Latin America & Caribbean (developing only)"},"incomeLevel":{"id":"LMC","value":"Lower middle income"},"lendingType":{"id":"IDB","value":"Blend"},"capitalCity":"La Paz","longitude":"-66.1936","latitude":"-13.9908"},{"id":"BRA","iso2Code":"BR","name":"Brazil","region":{"id":"LCN","value":"Latin America & Caribbean (all income levels)"},"adminregion":{"id":"LAC","value":"Latin America & Caribbean (developing only)"},"incomeLevel":{"id":"UMC","value":"Upper middle income"},"lendingType":{"id":"IBD","value":"IBRD"},"capitalCity":"Brasilia","longitude":"-47.9292","latitude":"-15.7801"},{"id":"BRB","iso2Code":"BB","name":"Barbados","region":{"id":"LCN","value":"Latin America & Caribbean (all income levels)"},"adminregion":{"id":"","value":""},"incomeLevel":{"id":"NOC","value":"High income: nonOECD"},"lendingType":{"id":"NC","value":"Not classified"},"capitalCity":"Bridgetown","longitude":"-59.6105","latitude":"13.0935"},{"id":"BRN","iso2Code":"BN","name":"Brunei Darussalam","region":{"id":"EAS","value":"East Asia & Pacific (all income levels)"},"adminregion":{"id":"","value":""},"incomeLevel":{"id":"NOC","value":"High income: nonOECD"},"lendingType":{"id":"NC","value":"Not classified"},"capitalCity":"Bandar Seri Begawan","longitude":"114.946","latitude":"4.94199"},{"id":"BTN","iso2Code":"BT","name":"Bhutan","region":{"id":"SAS","value":"South Asia"},"adminregion":{"id":"SAS","value":"South Asia"},"incomeLevel":{"id":"LMC","value":"Lower middle income"},"lendingType":{"id":"IDX","value":"IDA"},"capitalCity":"Thimphu","longitude":"89.6177","latitude":"27.5768"},{"id":"BWA","iso2Code":"BW","name":"Botswana","region":{"id":"SSF","value":"Sub-Saharan Africa (all income levels)"},"adminregion":{"id":"SSA","value":"Sub-Saharan Africa (developing only)"},"incomeLevel":{"id":"UMC","value":"Upper middle income"},"lendingType":{"id":"IBD","value":"IBRD"},"capitalCity":"Gaborone","longitude":"25.9201","latitude":"-24.6544"},{"id":"CAF","iso2Code":"CF","name":"Central African Republic","region":{"id":"SSF","value":"Sub-Saharan Africa (all income levels)"},"adminregion":{"id":"SSA","value":"Sub-Saharan Africa (developing only)"},"incomeLevel":{"id":"LIC","value":"Low income"},"lendingType":{"id":"IDX","value":"IDA"},"capitalCity":"Bangui","longitude":"21.6407","latitude":"5.63056"},{"id":"CAN","iso2Code":"CA","name":"Canada","region":{"id":"NAC","value":"North America"},"adminregion":{"id":"","value":""},"incomeLevel":{"id":"OEC","value":"High income: OECD"},"lendingType":{"id":"NC","value":"Not classified"},"capitalCity":"Ottawa","longitude":"-75.6919","latitude":"45.4215"},{"id":"CHE","iso2Code":"CH","name":"Switzerland","region":{"id":"ECS","value":"Europe & Central Asia (all income levels)"},"adminregion":{"id":"","value":""},"incomeLevel":{"id":"OEC","value":"High income: OECD"},"lendingType":{"id":"NC","value":"Not classified"},"capitalCity":"Bern","longitude":"7.44821","latitude":"46.948"},{"id":"CHI","iso2Code":"JG","name":"Channel Islands","region":{"id":"ECS","value":"Europe & Central Asia (all income levels)"},"adminregion":{"id":"","value":""},"incomeLevel":{"id":"NOC","value":"High income: nonOECD"},"lendingType":{"id":"NC","value":"Not classified"},"capitalCity":"","longitude":"","latitude":""},{"id":"CHL","iso2Code":"CL","name":"Chile","region":{"id":"LCN","value":"Latin America & Caribbean (all income levels)"},"adminregion":{"id":"LAC","value":"Latin America & Caribbean (developing only)"},"incomeLevel":{"id":"UMC","value":"Upper middle income"},"lendingType":{"id":"IBD","value":"IBRD"},"capitalCity":"Santiago","longitude":"-70.6475","latitude":"-33.475"},{"id":"CHN","iso2Code":"CN","name":"China","region":{"id":"EAS","value":"East Asia & Pacific (all income levels)"},"adminregion":{"id":"EAP","value":"East Asia & Pacific (developing only)"},"incomeLevel":{"id":"LMC","value":"Lower middle income"},"lendingType":{"id":"IBD","value":"IBRD"},"capitalCity":"Beijing","longitude":"116.286","latitude":"40.0495"},{"id":"CIV","iso2Code":"CI","name":"Cote d'Ivoire","region":{"id":"SSF","value":"Sub-Saharan Africa (all income levels)"},"adminregion":{"id":"SSA","value":"Sub-Saharan Africa (developing only)"},"incomeLevel":{"id":"LMC","value":"Lower middle income"},"lendingType":{"id":"IDX","value":"IDA"},"capitalCity":"Yamoussoukro","longitude":"-4.0305","latitude":"5.332"},{"id":"CMR","iso2Code":"CM","name":"Cameroon","region":{"id":"SSF","value":"Sub-Saharan Africa (all income levels)"},"adminregion":{"id":"SSA","value":"Sub-Saharan Africa (developing only)"},"incomeLevel":{"id":"LMC","value":"Lower middle income"},"lendingType":{"id":"IDX","value":"IDA"},"capitalCity":"Yaounde","longitude":"11.5174","latitude":"3.8721"},{"id":"COD","iso2Code":"CD","name":"Congo, Dem. Rep.","region":{"id":"SSF","value":"Sub-Saharan Africa (all income levels)"},"adminregion":{"id":"SSA","value":"Sub-Saharan Africa (developing only)"},"incomeLevel":{"id":"LIC","value":"Low income"},"lendingType":{"id":"IDX","value":"IDA"},"capitalCity":"Kinshasa","longitude":"15.3222","latitude":"-4.325"},{"id":"COG","iso2Code":"CG","name":"Congo, Rep.","region":{"id":"SSF","value":"Sub-Saharan Africa (all income levels)"},"adminregion":{"id":"SSA","value":"Sub-Saharan Africa (developing only)"},"incomeLevel":{"id":"LMC","value":"Lower middle income"},"lendingType":{"id":"IDX","value":"IDA"},"capitalCity":"Brazzaville","longitude":"15.2662","latitude":"-4.2767"},{"id":"COL","iso2Code":"CO","name":"Colombia","region":{"id":"LCN","value":"Latin America & Caribbean (all income levels)"},"adminregion":{"id":"LAC","value":"Latin America & Caribbean (developing only)"},"incomeLevel":{"id":"UMC","value":"Upper middle income"},"lendingType":{"id":"IBD","value":"IBRD"},"capitalCity":"Bogota","longitude":"-74.082","latitude":"4.60987"},{"id":"COM","iso2Code":"KM","name":"Comoros","region":{"id":"SSF","value":"Sub-Saharan Africa (all income levels)"},"adminregion":{"id":"SSA","value":"Sub-Saharan Africa (developing only)"},"incomeLevel":{"id":"LIC","value":"Low income"},"lendingType":{"id":"IDX","value":"IDA"},"capitalCity":"Moroni","longitude":"43.2418","latitude":"-11.6986"},{"id":"CPV","iso2Code":"CV","name":"Cape Verde","region":{"id":"SSF","value":"Sub-Saharan Africa (all income levels)"},"adminregion":{"id":"SSA","value":"Sub-Saharan Africa (developing only)"},"incomeLevel":{"id":"LMC","value":"Lower middle income"},"lendingType":{"id":"IDB","value":"Blend"},"capitalCity":"Praia","longitude":"-23.5087","latitude":"14.9218"},{"id":"CRI","iso2Code":"CR","name":"Costa Rica","region":{"id":"LCN","value":"Latin America & Caribbean (all income levels)"},"adminregion":{"id":"LAC","value":"Latin America & Caribbean (developing only)"},"incomeLevel":{"id":"UMC","value":"Upper middle income"},"lendingType":{"id":"IBD","value":"IBRD"},"capitalCity":"San Jose","longitude":"-84.0089","latitude":"9.63701"},{"id":"CUB","iso2Code":"CU","name":"Cuba","region":{"id":"LCN","value":"Latin America & Caribbean (all income levels)"},"adminregion":{"id":"LAC","value":"Latin America & Caribbean (developing only)"},"incomeLevel":{"id":"UMC","value":"Upper middle income"},"lendingType":{"id":"NC","value":"Not classified"},"capitalCity":"Havana","longitude":"-82.3667","latitude":"23.1333"},{"id":"CYM","iso2Code":"KY","name":"Cayman Islands","region":{"id":"LCN","value":"Latin America & Caribbean (all income levels)"},"adminregion":{"id":"","value":""},"incomeLevel":{"id":"NOC","value":"High income: nonOECD"},"lendingType":{"id":"NC","value":"Not classified"},"capitalCity":"George Town","longitude":"-81.3857","latitude":"19.3022"},{"id":"CYP","iso2Code":"CY","name":"Cyprus","region":{"id":"ECS","value":"Europe & Central Asia (all income levels)"},"adminregion":{"id":"","value":""},"incomeLevel":{"id":"NOC","value":"High income: nonOECD"},"lendingType":{"id":"NC","value":"Not classified"},"capitalCity":"Nicosia","longitude":"33.3736","latitude":"35.1676"}]]
2
+
@@ -0,0 +1,2 @@
1
+ [{"page":1,"pages":1,"per_page":"50","total":1},[{"id":"IND","iso2Code":"IN","name":"India","region":{"id":"SAS","value":"South Asia"},"adminregion":{"id":"SAS","value":"South Asia"},"incomeLevel":{"id":"LMC","value":"Lower middle income"},"lendingType":{"id":"IDB","value":"Blend"},"capitalCity":"New Delhi","longitude":"77.225","latitude":"28.6353"}]]
2
+
@@ -0,0 +1 @@
1
+ [{"page":"1","pages":"1","per_page":"50","total":"1"},[{"id":"LMC","value":"Lower middle income"}]]
@@ -0,0 +1,2 @@
1
+ [{"page":"1","pages":"1","per_page":"50","total":"9"},[{"id":"HIC","value":"High income"},{"id":"HPC","value":"Heavily indebted poor countries (HIPC)"},{"id":"LIC","value":"Low income"},{"id":"LMC","value":"Lower middle income"},{"id":"LMY","value":"Low & middle income"},{"id":"MIC","value":"Middle income"},{"id":"NOC","value":"High income: nonOECD"},{"id":"OEC","value":"High income: OECD"},{"id":"UMC","value":"Upper middle income"}]]
2
+
@@ -0,0 +1,2 @@
1
+ [{"page":1,"pages":82,"per_page":"50","total":4073},[{"id":"AG.AGR.TRAC.NO","name":"Agricultural machinery, tractors","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Agricultural machinery refers to the number of wheel and crawler tractors (excluding garden tractors) in use in agriculture at the end of the calendar year specified or during the first quarter of the following year.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "}]},{"id":"AG.AID.CREL.MT","name":"Cereal food aid shipments (FAO, tonnes)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.CON.FERT.MT","name":"Fertilizer consumption (metric tons)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"Fertilizer consumption measures the quantity of plant nutrients used per unit of arable land. Fertilizer products cover nitrogenous, potash, and phosphate fertilizers (including ground rock phosphate). Traditional nutrients--animal and plant manures--are not included. For the purpose of data dissemination, FAO has adopted the concept of a calendar year (January to December). Some countries compile fertilizer data on a calendar year basis, while others are on a split-year basis.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "}]},{"id":"AG.CON.FERT.PT.ZS","name":"Fertilizer consumption (% of fertilizer production)","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Fertilizer consumption measures the quantity of plant nutrients used per unit of arable land. Fertilizer products cover nitrogenous, potash, and phosphate fertilizers (including ground rock phosphate). Traditional nutrients--animal and plant manures--are not included. For the purpose of data dissemination, FAO has adopted the concept of a calendar year (January to December). Some countries compile fertilizer data on a calendar year basis, while others are on a split-year basis.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "}]},{"id":"AG.CON.FERT.ZS","name":"Fertilizer consumption (kilograms per hectare of arable land)","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Fertilizer consumption (100 grams per hectare of arable land) measures the quantity of plant nutrients used per unit of arable land. Fertilizer products cover nitrogenous, potash, and phosphate fertilizers (including ground rock phosphate). Traditional nutrients--animal and plant manures--are not included. For the purpose of data dissemination, FAO has adopted the concept of a calendar year (January to December). Some countries compile fertilizer data on a calendar year basis, while others are on a split-year basis. Arable land includes land defined by the FAO as land under temporary crops (double-cropped areas are counted once), temporary meadows for mowing or for pasture, land under market or kitchen gardens, and land temporarily fallow. Land abandoned as a result of shifting cultivation is excluded.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "}]},{"id":"AG.CRP.BLY.CD","name":"Producer Price for Barley (per tonne, current US$)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.CRP.BLY.CN","name":"Producer Price for Barley (per tonne, current LCU)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.CRP.FNO.CD","name":"Producer Price for Fonio (per tonne, current US$)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.CRP.FNO.CN","name":"Producer Price for Fonio (per tonne, current LCU)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.CRP.MLT.CD","name":"Producer Price for Millet (per tonne, current US$)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.CRP.MLT.CN","name":"Producer Price for Millet (per tonne, current LCU)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.CRP.MZE.CD","name":"Producer Price for Maize (per tonne, current US$)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.CRP.MZE.CN","name":"Producer Price for Maize (per tonne, current LCU)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.CRP.RICE.CD","name":"Producer Price for Rice, paddy (per tonne, current US$)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.CRP.RICE.CN","name":"Producer Price for Rice, paddy (per tonne, current LCU)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.CRP.SGM.CD","name":"Producer Price for Sorghum (per tonne, current US$)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.CRP.SGM.CN","name":"Producer Price for Sorghum (per tonne, current LCU)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.CRP.WHT.CD","name":"Producer Price for Wheat (per tonne, current US$)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.CRP.WHT.CN","name":"Producer Price for Wheat (per tonne, current LCU)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.FRST.PROD.WOOD","name":"Wood fuel production quantity (CUM, solid volume units)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.LND.AGRI.HA","name":"Agricultural land (hectares)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.LND.AGRI.K2","name":"Agricultural land (sq. km)","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Agricultural land refers to the share of land area that is arable, under permanent crops, and under permanent pastures. Arable land includes land defined by the FAO as land under temporary crops (double-cropped areas are counted once), temporary meadows for mowing or for pasture, land under market or kitchen gardens, and land temporarily fallow. Land abandoned as a result of shifting cultivation is excluded. Land under permanent crops is land cultivated with crops that occupy the land for long periods and need not be replanted after each harvest, such as cocoa, coffee, and rubber. This category includes land under flowering shrubs, fruit trees, nut trees, and vines, but excludes land under trees grown for wood or timber. Permanent pasture is land used for five or more years for forage, including natural and cultivated crops.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "}]},{"id":"AG.LND.AGRI.ZS","name":"Agricultural land (% of land area)","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Agricultural land refers to the share of land area that is arable, under permanent crops, and under permanent pastures. Arable land includes land defined by the FAO as land under temporary crops (double-cropped areas are counted once), temporary meadows for mowing or for pasture, land under market or kitchen gardens, and land temporarily fallow. Land abandoned as a result of shifting cultivation is excluded. Land under permanent crops is land cultivated with crops that occupy the land for long periods and need not be replanted after each harvest, such as cocoa, coffee, and rubber. This category includes land under flowering shrubs, fruit trees, nut trees, and vines, but excludes land under trees grown for wood or timber. Permanent pasture is land used for five or more years for forage, including natural and cultivated crops.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "}]},{"id":"AG.LND.ARBL.HA","name":"Arable land (hectares)","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Arable land (in hectares) includes land defined by the FAO as land under temporary crops (double-cropped areas are counted once), temporary meadows for mowing or for pasture, land under market or kitchen gardens, and land temporarily fallow. Land abandoned as a result of shifting cultivation is excluded.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "}]},{"id":"AG.LND.ARBL.HA.PC","name":"Arable land (hectares per person)","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Arable land (hectares per person) includes land defined by the FAO as land under temporary crops (double-cropped areas are counted once), temporary meadows for mowing or for pasture, land under market or kitchen gardens, and land temporarily fallow. Land abandoned as a result of shifting cultivation is excluded.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "}]},{"id":"AG.LND.ARBL.ZS","name":"Arable land (% of land area)","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Arable land includes land defined by the FAO as land under temporary crops (double-cropped areas are counted once), temporary meadows for mowing or for pasture, land under market or kitchen gardens, and land temporarily fallow. Land abandoned as a result of shifting cultivation is excluded.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "}]},{"id":"AG.LND.CERE.ZS","name":"Cereal cropland (% of land area)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.LND.CREL.HA","name":"Land under cereal production (hectares)","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Land under cereal production refers to harvested area, although some countries report only sown or cultivated area. Cereals include wheat, rice, maize, barley, oats, rye, millet, sorghum, buckwheat, and mixed grains. Production data on cereals relate to crops harvested for dry grain only. Cereal crops harvested for hay or harvested green for food, feed, or silage and those used for grazing are excluded.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "}]},{"id":"AG.LND.CROP.HA","name":"Permanent cropland (hectares)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.LND.CROP.ZS","name":"Permanent cropland (% of land area)","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Permanent cropland is land cultivated with crops that occupy the land for long periods and need not be replanted after each harvest, such as cocoa, coffee, and rubber. This category includes land under flowering shrubs, fruit trees, nut trees, and vines, but excludes land under trees grown for wood or timber.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "}]},{"id":"AG.LND.CRPA.HA","name":"Arable and permanent cropland (hectares)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.LND.FRST.K2","name":"Forest area (sq. km)","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Forest area is land under natural or planted stands of trees of at least 5 meters in situ, whether productive or not, and excludes tree stands in agricultural production systems (for example, in fruit plantations and agroforestry systems) and trees in urban parks and gardens.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"6","value":"Environment "},{"id":"1","value":"Agriculture & Rural Development "}]},{"id":"AG.LND.FRST.ZS","name":"Forest area (% of land area)","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Forest area is land under natural or planted stands of trees of at least 5 meters in situ, whether productive or not, and excludes tree stands in agricultural production systems (for example, in fruit plantations and agroforestry systems) and trees in urban parks and gardens.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "},{"id":"6","value":"Environment "}]},{"id":"AG.LND.IRIG.AG.ZS","name":"Agricultural irrigated land (% of total agricultural land)","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Agricultural irrigated land refers to agricultural areas purposely provided with water, including land irrigated by controlled flooding.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "}]},{"id":"AG.LND.IRIG.PO.HA","name":"Land area equipped for irrigation (hectares)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[]},{"id":"AG.LND.IRIG.ZS","name":"Irrigated land (% of crop land)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"Irrigated land refers to areas purposely provided with water, including land irrigated by controlled flooding. Cropland refers to arable land and permanent cropland.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[]},{"id":"AG.LND.PRCP.MM","name":"Average precipitation in depth (mm per year) ","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Average precipitation is the long-term average in depth (over space and time) of annual precipitation in the country. Precipitation is defined as any kind of water that falls from clouds as a liquid or a solid.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "}]},{"id":"AG.LND.TOTL.HA","name":"Land area (hectares)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.LND.TOTL.K2","name":"Land area (sq. km)","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Land area is a country's total area, excluding area under inland water bodies, national claims to continental shelf, and exclusive economic zones. In most cases the definition of inland water bodies includes major rivers and lakes.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "}]},{"id":"AG.LND.TRAC.ZS","name":"Agricultural machinery, tractors per 100 sq. km of arable land","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Agricultural machinery refers to the number of wheel and crawler tractors (excluding garden tractors) in use in agriculture at the end of the calendar year specified or during the first quarter of the following year. Arable land includes land defined by the FAO as land under temporary crops (double-cropped areas are counted once), temporary meadows for mowing or for pasture, land under market or kitchen gardens, and land temporarily fallow. Land abandoned as a result of shifting cultivation is excluded.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "}]},{"id":"AG.LNF.FRST.HA","name":"Forest area (hectares)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.PRD.AGRI.XD","name":"Gross agriculture production index (1999-2001 = 100)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.PRD.CREL.MT","name":"Cereal production (metric tons)","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Production data on cereals relate to crops harvested for dry grain only. Cereal crops harvested for hay or harvested green for food, feed, or silage and those used for grazing are excluded.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"6","value":"Environment "}]},{"id":"AG.PRD.CREL.XD","name":"Gross cereal production index (1999-2001 = 100)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.PRD.CROP.XD","name":"Crop production index (1999-2001 = 100)","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Crop production index shows agricultural production for each year relative to the base period 1999-2001. It includes all crops except fodder crops. Regional and income group aggregates for the FAO's production indexes are calculated from the underlying values in international dollars, normalized to the base period 1999-2001.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "}]},{"id":"AG.PRD.FOOD.XD","name":"Food production index (1999-2001 = 100)","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Food production index covers food crops that are considered edible and that contain nutrients. Coffee and tea are excluded because, although edible, they have no nutritive value.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "}]},{"id":"AG.PRD.LVSK.XD","name":"Livestock production index (1999-2001 = 100)","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Livestock production index includes meat and milk from all sources, dairy products such as cheese, and eggs, honey, raw silk, wool, and hides and skins.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "}]},{"id":"AG.PRD.NFOOD.XD","name":"Gross non-food production index (1999-2001 = 100)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.SED.CREL.MT","name":"Cereal seed quantity (FAO, tonnes)","source":{"id":"11","value":"Africa Development Indicators"},"sourceNote":"","sourceOrganization":"","topics":[]},{"id":"AG.SRF.TOTL.K2","name":"Surface area (sq. km)","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Surface area is a country's total area, including areas under inland bodies of water and some coastal waterways.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "}]}]]
2
+
@@ -0,0 +1 @@
1
+ [{"page":1,"pages":1,"per_page":"50","total":1},[{"id":"AG.AGR.TRAC.NO","name":"Agricultural machinery, tractors","source":{"id":"2","value":"World Development Indicators"},"sourceNote":"Agricultural machinery refers to the number of wheel and crawler tractors (excluding garden tractors) in use in agriculture at the end of the calendar year specified or during the first quarter of the following year.","sourceOrganization":"Food and Agriculture Organization, electronic files and web site.","topics":[{"id":"1","value":"Agriculture & Rural Development "}]}]]
@@ -0,0 +1 @@
1
+ [{"page":"1","pages":"1","per_page":"50","total":"1"},[{"id":"IDB","value":"Blend"}]]
@@ -0,0 +1 @@
1
+ [{"page":"1","pages":"1","per_page":"50","total":"4"},[{"id":"IBD","value":"IBRD"},{"id":"IDB","value":"Blend"},{"id":"IDX","value":"IDA"},{"id":"NC","value":"Not classified"}]]
@@ -0,0 +1,2 @@
1
+ [{"page":"1","pages":"1","per_page":"50","total":"18"},[{"id":"","code":"ARB","name":"Arab World"},{"id":"","code":"EAP","name":"East Asia & Pacific (developing only)"},{"id":"1","code":"EAS","name":"East Asia & Pacific (all income levels)"},{"id":"","code":"ECA","name":"Europe & Central Asia (developing only)"},{"id":"2","code":"ECS","name":"Europe & Central Asia (all income levels)"},{"id":"","code":"EMU","name":"Euro area"},{"id":"","code":"EUU","name":"European Union"},{"id":"","code":"LAC","name":"Latin America & Caribbean (developing only)"},{"id":"3","code":"LCN","name":"Latin America & Caribbean (all income levels)"},{"id":"","code":"LDC","name":"Least developed countries: UN classification"},{"id":"4","code":"MEA","name":"Middle East & North Africa (all income levels)"},{"id":"","code":"MNA","name":"Middle East & North Africa (developing only)"},{"id":"6","code":"NAC","name":"North America"},{"id":"","code":"OED","name":"OECD members"},{"id":"8","code":"SAS","name":"South Asia"},{"id":"","code":"SSA","name":"Sub-Saharan Africa (developing only)"},{"id":"9","code":"SSF","name":"Sub-Saharan Africa (all income levels)"},{"id":"","code":"WLD","name":"World"}]]
2
+
@@ -0,0 +1 @@
1
+ [{"page":"1","pages":"1","per_page":"50","total":"1"},[{"id":"","code":"WLD","name":"World"}]]
@@ -0,0 +1,2 @@
1
+ [{"page":"1","pages":"1","per_page":"50","total":"1"},[{"id":"21","name":"Global Economic Monitor (GEM) Commodities","description":"","url":""}]]
2
+
@@ -0,0 +1 @@
1
+ [{"page":"1","pages":"1","per_page":"50","total":"14"},[{"id":"11","name":"Africa Development Indicators","description":"","url":""},{"id":"1","name":"Doing Business","description":"","url":""},{"id":"12","name":"Education Statistics","description":"","url":""},{"id":"13","name":"Enterprise Surveys","description":"","url":""},{"id":"6","name":"Global Development Finance","description":"","url":""},{"id":"14","name":"Gender Statistics","description":"","url":""},{"id":"15","name":"Global Economic Monitor","description":"","url":""},{"id":"21","name":"Global Economic Monitor (GEM) Commodities","description":"","url":""},{"id":"16","name":"Health Nutrition and Population Statistics","description":"","url":""},{"id":"18","name":"International Development Association - Results Measurement System","description":"","url":""},{"id":"19","name":"Millennium Development Goals","description":"","url":""},{"id":"20","name":"Public Sector Debt","description":"","url":""},{"id":"2","name":"World Development Indicators","description":"","url":""},{"id":"3","name":"Worldwide Governance Indicators","description":"","url":""}]]
@@ -0,0 +1,2 @@
1
+ [{"page":1,"pages":1,"per_page":"50","total":1},[{"id":"6","value":"Environment ","sourceNote":"Natural and man-made environmental resources – fresh water, clean air, forests, grasslands, marine resources, and agro-ecosystems – provide sustenance and a foundation for social and economic development. The need to safeguard these resources crosses all borders. Today, the World Bank is one of the key promoters and financiers of environmental upgrading in the developing world. Data here cover forests, biodiversity, emissions, and pollution. Other indicators relevant to the environment are found under data pages for Agriculture & Rural Development, Energy & Mining, Infrastructure, and Urban Development."}]]
2
+
@@ -0,0 +1,2 @@
1
+ [{"page":1,"pages":1,"per_page":"50","total":18},[{"id":"1","value":"Agriculture & Rural Development ","sourceNote":"For the 70 percent of the world's poor who live in rural areas, agriculture is the main source of income and employment. But depletion and degradation of land and water pose serious challenges to producing enough food and other agricultural products to sustain livelihoods here and meet the needs of urban populations. Data presented here include measures of agricultural inputs, outputs, and productivity compiled by the UN's Food and Agriculture Organization."},{"id":"2","value":"Aid Effectiveness ","sourceNote":"Aid effectiveness is the impact that aid has in reducing poverty and inequality, increasing growth, building capacity, and accelerating achievement of the Millennium Development Goals set by the international community. Indicators here cover aid received as well as progress in reducing poverty and improving education, health, and other measures of human welfare."},{"id":"3","value":"Economic Policy and External Debt ","sourceNote":"Economic indicators measure outcomes in the structure and rates of change of output, trade, and aggregate demand, and in macroeconomic performance. The data here consist of national accounts, government finances, money supply, prices, balance of payments, and external debt. Data are gathered from national statistical organizations and central banks by World Bank missions and from the International Monetary Fund's data files."},{"id":"4","value":"Education ","sourceNote":"Education is one of the most powerful instruments for reducing poverty and inequality and lays a foundation for sustained economic growth. The World Bank compiles data on education inputs, participation, efficiency, and outcomes. Data on education are compiled by the United Nations Educational, Scientific, and Cultural Organization (UNESCO) Institute for Statistics from official responses to surveys and from reports provided by education authorities in each country."},{"id":"5","value":"Energy & Mining ","sourceNote":"The world economy needs ever-increasing amounts of energy to sustain economic growth, raise living standards, and reduce poverty. But today's trends in energy use are not sustainable. As the world's population grows and economies become more industrialized, nonrenewable energy sources will become scarcer and more costly. Data here on energy production, use, dependency, and efficiency are compiled by the World Bank from the International Energy Agency and the Carbon Dioxide Information Analysis Center."},{"id":"6","value":"Environment ","sourceNote":"Natural and man-made environmental resources – fresh water, clean air, forests, grasslands, marine resources, and agro-ecosystems – provide sustenance and a foundation for social and economic development. The need to safeguard these resources crosses all borders. Today, the World Bank is one of the key promoters and financiers of environmental upgrading in the developing world. Data here cover forests, biodiversity, emissions, and pollution. Other indicators relevant to the environment are found under data pages for Agriculture & Rural Development, Energy & Mining, Infrastructure, and Urban Development."},{"id":"7","value":"Financial Sector ","sourceNote":"An economy's financial markets are critical to its overall development. Banking systems and stock markets enhance growth, the main factor in poverty reduction. Strong financial systems provide reliable and accessible information that lowers transaction costs, which in turn bolsters resource allocation and economic growth. Indicators here include the size and liquidity of stock markets; the accessibility, stability, and efficiency of financial systems; and international migration and workers\\ remittances, which affect growth and social welfare in both sending and receiving countries."},{"id":"8","value":"Health ","sourceNote":"Improving health is central to the Millennium Development Goals, and the public sector is the main provider of health care in developing countries. To reduce inequities, many countries have emphasized primary health care, including immunization, sanitation, access to safe drinking water, and safe motherhood initiatives. Data here cover health systems, disease prevention, reproductive health, nutrition, and population dynamics. Data are from the United Nations Population Division, World Health Organization, United Nations Children's Fund, the Joint United Nations Programme on HIV\/AIDS, and various other sources."},{"id":"9","value":"Infrastructure ","sourceNote":"Infrastructure helps determine the success of manufacturing and agricultural activities. Investments in water, sanitation, energy, housing, and transport also improve lives and help reduce poverty. And new information and communication technologies promote growth, improve delivery of health and other services, expand the reach of education, and support social and cultural advances. Data here are compiled from such sources as the International Road Federation, Containerisation International, the International Civil Aviation Organization, the International Energy Association, and the International Telecommunications Union."},{"id":"10","value":"Labor & Social Protection ","sourceNote":"The supply of labor available in an economy includes people who are employed, those who are unemployed but seeking work, and first-time job-seekers. Not everyone who works is included: unpaid workers, family workers, and students are often omitted, while some countries do not count members of the armed forces. Data on labor and employment are compiled by the International Labour Organization (ILO) from labor force surveys, censuses, establishment censuses and surveys, and administrative records such as employment exchange registers and unemployment insurance schemes."},{"id":"11","value":"Poverty ","sourceNote":"The World Bank periodically prepares poverty assessments of countries in which it has an active program, in close collaboration with national institutions, other development agencies, and civil society, including poor people's organizations. Assessments report the extent and causes of poverty and propose strategies to reduce it. Countries have varying definitions of poverty, and comparisons can be difficult. National poverty lines tend to have higher purchasing power in rich countries, where standards used are more generous than in poor countries. Poverty measures based on an international poverty line attempt to hold the real value of the poverty line constant across countries, including when making comparisons over time. Data here includes measures of population living below the national poverty line as well as the international poverty line. Also included are income distributions and urban and rural poverty rates."},{"id":"12","value":"Private Sector","sourceNote":"Private markets drive economic growth, tapping initiative and investment to create productive jobs and raise incomes. Trade is also a driver of economic growth as it integrates developing countries into the world economy and generates benefits for their people. Data on the private sector and trade are from the World Bank Group's Private Participation in Infrastructure Project Database, Enterprise Surveys, and Doing Business Indicators, as well as from the International Monetary Fund's Balance of Payments database and International Financial Statistics, the UN Commission on Trade and Development, the World Trade Organization, and various other sources."},{"id":"13","value":"Public Sector ","sourceNote":"Effective governments improve people's standard of living by ensuring access to essential services – health, education, water and sanitation, electricity, transport – and the opportunity to live and work in peace and security. Data here includes World Bank staff assessments of country performance in economic management, structural policies, policies for social inclusion and equity, and public sector management and institutions for the poorest countries. Also included are indicators on revenues and expenses from the International Monetary Fund's Government Finance Statistics, and on tax policies from various sources."},{"id":"14","value":"Science & Technology ","sourceNote":"Technological innovation, often fueled by governments, drives industrial growth and helps raise living standards. Data here aims to shed light on countries technology base: research and development, scientific and technical journal articles, high-technology exports, royalty and license fees, and patents and trademarks. Sources include the UNESCO Institute for Statistics, the U.S. National Science Board, the UN Statistics Division, the International Monetary Fund, and the World Intellectual Property Organization."},{"id":"15","value":"Social Development ","sourceNote":"Data here cover child labor, gender issues, refugees, and asylum seekers. Children in many countries work long hours, often combining studying with work for pay. The data on their paid work are from household surveys conducted by the International Labour Organization (ILO), the United Nations Children's Fund (UNICEF), the World Bank, and national statistical offices. Gender disparities are measured using a compilation of data on key topics such as education, health, labor force participation, and political participation. Data on refugees are from the United Nations High Commissioner for Refugees complemented by statistics on Palestinian refugees under the mandate of the United Nations Relief and Works Agency."},{"id":"16","value":"Urban Development ","sourceNote":"Cities can be tremendously efficient. It is easier to provide water and sanitation to people living closer together, while access to health, education, and other social and cultural services is also much more readily available. However, as cities grow, the cost of meeting basic needs increases, as does the strain on the environment and natural resources. Data on urbanization, traffic and congestion, and air pollution are from the United Nations Population Division, World Health Organization, International Road Federation, World Resources Institute, and other sources."},{"id":"17","value":"Gender Statistics","sourceNote":""},{"id":"18","value":"Millenium development goals","sourceNote":""}]]
2
+
data/spec/helper.rb ADDED
@@ -0,0 +1,48 @@
1
+ $:.unshift File.expand_path('..', __FILE__)
2
+ $:.unshift File.expand_path('../../lib', __FILE__)
3
+ require 'simplecov'
4
+ SimpleCov.start
5
+ require 'worldbank_as_dataframe'
6
+ require 'rspec'
7
+ require 'webmock/rspec'
8
+
9
+
10
+ def a_delete(path)
11
+ a_request(:delete, 'http://api.worldbank.org/v2/' + path)
12
+ end
13
+
14
+ def a_get(path)
15
+ a_request(:get, 'http://api.worldbank.org/v2/' + path)
16
+ end
17
+
18
+ def a_post(path)
19
+ a_request(:post, 'http://api.worldbank.org/v2/' + path)
20
+ end
21
+
22
+ def a_put(path)
23
+ a_request(:put, 'http://api.worldbank.org/v2/' + path)
24
+ end
25
+
26
+ def stub_delete(path)
27
+ stub_request(:delete, 'http://api.worldbank.org/v2/' + path)
28
+ end
29
+
30
+ def stub_get(path)
31
+ stub_request(:get, 'http://api.worldbank.org/v2/' + path)
32
+ end
33
+
34
+ def stub_post(path)
35
+ stub_request(:post, 'http://api.worldbank.org/v2/' + path)
36
+ end
37
+
38
+ def stub_put(path)
39
+ stub_request(:put, 'http://api.worldbank.org/v2/' + path)
40
+ end
41
+
42
+ def fixture_path
43
+ File.expand_path('../fixtures', __FILE__)
44
+ end
45
+
46
+ def fixture(file)
47
+ File.new(fixture_path + '/' + file)
48
+ end