apiverve_gdp 1.2.4 → 1.2.6
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.
- checksums.yaml +4 -4
- data/README.md +26 -14
- data/lib/apiverve_gdp/client.rb +2 -2
- data/lib/apiverve_gdp.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7d9e7dac990ca2099dc24b695d7a14c14f6b040d6a52597ac6585b998c16d68f
|
|
4
|
+
data.tar.gz: 9e883c8d609221b6e560777bbce3f9ea03ddb214ea20ca6535dc8f4d5e542afb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 995a2d3def96c3e5ed1a451662e84a16553194ccd8cfb77f165f95c5bf9287e72245027ab9dab6d4b556daae2bddb86f0d27da3453dc6c24b3ca9754b420d44e
|
|
7
|
+
data.tar.gz: 0db15ebee72f0bf28f7af0c0a9f02af4c2387fa13caffbd8e5b6ccb640c16acc71b55269bcffbb4e9df3906061edc03f1b90db558cc30779b8123e5e1645ed4e
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# GDP Data API - Ruby Gem
|
|
2
2
|
|
|
3
|
-
Get GDP (Gross Domestic Product) data for any country including current values and historical data going back to 1960.
|
|
3
|
+
Get GDP (Gross Domestic Product) data for any country including current values and historical data going back to 1960. With changes=true it also returns the direction against the previous year, and on paid plans the prior year's GDP, the dollar and percent change, whether real growth is accelerating or slowing, and 5- and 10-year compound annual growth.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -37,7 +37,8 @@ client = APIVerve::Gdp::Client.new(api_key: "YOUR_API_KEY")
|
|
|
37
37
|
# Make a request
|
|
38
38
|
response = client.execute({
|
|
39
39
|
country: "US",
|
|
40
|
-
year: 2023
|
|
40
|
+
year: 2023,
|
|
41
|
+
changes: true
|
|
41
42
|
})
|
|
42
43
|
|
|
43
44
|
# Print the response
|
|
@@ -49,7 +50,7 @@ puts response
|
|
|
49
50
|
|
|
50
51
|
```ruby
|
|
51
52
|
begin
|
|
52
|
-
response = client.execute({ country: "US", year: 2023 })
|
|
53
|
+
response = client.execute({ country: "US", year: 2023, changes: true })
|
|
53
54
|
puts response["data"]
|
|
54
55
|
rescue APIVerve::Gdp::ValidationError => e
|
|
55
56
|
puts "Validation error: #{e.errors.join(', ')}"
|
|
@@ -79,21 +80,32 @@ client = APIVerve::Gdp::Client.new(
|
|
|
79
80
|
"country": "US",
|
|
80
81
|
"countryName": "United States",
|
|
81
82
|
"currency": "USD",
|
|
82
|
-
"year":
|
|
83
|
-
"gdp":
|
|
84
|
-
"gdpFormatted": "$
|
|
85
|
-
"gdpGrowth": 2.
|
|
86
|
-
"gdpPerCapita":
|
|
83
|
+
"year": 2025,
|
|
84
|
+
"gdp": 30769700000000,
|
|
85
|
+
"gdpFormatted": "$30.77 trillion",
|
|
86
|
+
"gdpGrowth": 2.16,
|
|
87
|
+
"gdpPerCapita": 90027,
|
|
87
88
|
"count": 1,
|
|
88
89
|
"years": [
|
|
89
90
|
{
|
|
90
|
-
"year":
|
|
91
|
-
"gdp":
|
|
92
|
-
"gdpFormatted": "$
|
|
93
|
-
"gdpGrowth": 2.
|
|
94
|
-
"gdpPerCapita":
|
|
91
|
+
"year": 2025,
|
|
92
|
+
"gdp": 30769700000000,
|
|
93
|
+
"gdpFormatted": "$30.77 trillion",
|
|
94
|
+
"gdpGrowth": 2.16,
|
|
95
|
+
"gdpPerCapita": 90027
|
|
95
96
|
}
|
|
96
|
-
]
|
|
97
|
+
],
|
|
98
|
+
"previousYear": 2024,
|
|
99
|
+
"changeDirection": "up",
|
|
100
|
+
"previousGdp": 29298013000000,
|
|
101
|
+
"gdpChange": 1471687000000,
|
|
102
|
+
"gdpChangePercent": 5.02,
|
|
103
|
+
"previousGdpGrowth": 2.79,
|
|
104
|
+
"growthTrend": "slowing",
|
|
105
|
+
"gdpPerCapitaChangePercent": 4.48,
|
|
106
|
+
"gdpCagr5y": 7.56,
|
|
107
|
+
"gdpCagr10y": 5.34,
|
|
108
|
+
"averageGrowth5y": 3.31
|
|
97
109
|
},
|
|
98
110
|
"code": 200
|
|
99
111
|
}
|
data/lib/apiverve_gdp/client.rb
CHANGED
|
@@ -10,7 +10,7 @@ module APIVerve
|
|
|
10
10
|
#
|
|
11
11
|
# @example Basic usage
|
|
12
12
|
# client = APIVerve::Gdp::Client.new(api_key: "your_api_key")
|
|
13
|
-
# response = client.execute({ country: "US", year: 2023 })
|
|
13
|
+
# response = client.execute({ country: "US", year: 2023, changes: true })
|
|
14
14
|
# puts response
|
|
15
15
|
#
|
|
16
16
|
# @see https://apiverve.com/marketplace/gdp?utm_source=ruby&utm_medium=referral&utm_content=readme
|
|
@@ -19,7 +19,7 @@ module APIVerve
|
|
|
19
19
|
DEFAULT_TIMEOUT = 30
|
|
20
20
|
|
|
21
21
|
# Validation rules for parameters
|
|
22
|
-
VALIDATION_RULES = { 'country' => { type: 'string', required: true, min_length: 2, max_length: 3 }, 'year' => { type: 'integer', required: false, min: 1960, max: 2030 } }
|
|
22
|
+
VALIDATION_RULES = { 'country' => { type: 'string', required: true, min_length: 2, max_length: 3 }, 'year' => { type: 'integer', required: false, min: 1960, max: 2030 }, 'changes' => { type: 'boolean', required: false } }
|
|
23
23
|
|
|
24
24
|
# Format validation patterns
|
|
25
25
|
FORMAT_PATTERNS = {
|
data/lib/apiverve_gdp.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: apiverve_gdp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- APIVerve
|
|
@@ -58,7 +58,10 @@ dependencies:
|
|
|
58
58
|
- !ruby/object:Gem::Version
|
|
59
59
|
version: '2.0'
|
|
60
60
|
description: Get GDP (Gross Domestic Product) data for any country including current
|
|
61
|
-
values and historical data going back to 1960.
|
|
61
|
+
values and historical data going back to 1960. With changes=true it also returns
|
|
62
|
+
the direction against the previous year, and on paid plans the prior year's GDP,
|
|
63
|
+
the dollar and percent change, whether real growth is accelerating or slowing, and
|
|
64
|
+
5- and 10-year compound annual growth.
|
|
62
65
|
email:
|
|
63
66
|
- hello@apiverve.com
|
|
64
67
|
executables: []
|