apiverve_inflation 1.2.4 → 1.2.5
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 +14 -5
- data/lib/apiverve_inflation/client.rb +2 -2
- data/lib/apiverve_inflation.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 275af2b2ab10e106c29acbadd02a2fc2fe4f86810749f526987bd257c5519645
|
|
4
|
+
data.tar.gz: c80e48db7caf2be5bf049a3443c1703159c28c9186ef8734a5a18c92dfefcaf6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b5dbbee69a4ee205eca167a1a86bc40a453d810d24a28f890934c0eb5dd16800b63a17211f0d64a89308d7333df2c7a97eca96dde31544601d5d8880b15a28a7
|
|
7
|
+
data.tar.gz: e7ee07edc5d01625b2326b00678130362781352ea99a34e4d88659ca72bd786c4f4819a6226ec2dd76463548655ef7cb0fe19a0feab44577281eef12750f4444
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Inflation Rate API - Ruby Gem
|
|
2
2
|
|
|
3
|
-
Inflation Rate reports annual inflation rates and Consumer Price Index (CPI) values for any country by two-letter country code. Outputs include the year-over-year price change percentage, CPI index, and base comparison year, with paid plans supporting historical lookups by year.
|
|
3
|
+
Inflation Rate reports annual inflation rates and Consumer Price Index (CPI) values for any country by two-letter country code. Outputs include the year-over-year price change percentage, CPI index, and base comparison year, with paid plans supporting historical lookups by year. On paid plans, changes=true adds the prior year's rate and the change from it, plus the 5-year average, high, low and cumulative CPI rise.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -37,7 +37,8 @@ client = APIVerve::Inflation::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::Inflation::ValidationError => e
|
|
55
56
|
puts "Validation error: #{e.errors.join(', ')}"
|
|
@@ -80,9 +81,17 @@ client = APIVerve::Inflation::Client.new(
|
|
|
80
81
|
"countryName": "United States",
|
|
81
82
|
"year": 2023,
|
|
82
83
|
"inflationRate": 4.12,
|
|
83
|
-
"cpiIndex": 139.
|
|
84
|
+
"cpiIndex": 139.74,
|
|
84
85
|
"cpiBaseYear": 2010,
|
|
85
|
-
"lastUpdated": "2026-
|
|
86
|
+
"lastUpdated": "2026-11-06T04:00:00.000Z",
|
|
87
|
+
"previousYear": 2022,
|
|
88
|
+
"previousInflationRate": 8,
|
|
89
|
+
"inflationRateChange": -3.88,
|
|
90
|
+
"changeDirection": "down",
|
|
91
|
+
"averageInflationRate5y": 3.97,
|
|
92
|
+
"highInflationRate5y": 8,
|
|
93
|
+
"lowInflationRate5y": 1.23,
|
|
94
|
+
"cpiChange5y": 21.34
|
|
86
95
|
}
|
|
87
96
|
}
|
|
88
97
|
```
|
|
@@ -10,7 +10,7 @@ module APIVerve
|
|
|
10
10
|
#
|
|
11
11
|
# @example Basic usage
|
|
12
12
|
# client = APIVerve::Inflation::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/inflation?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: 2 }, 'year' => { type: 'integer', required: false, min: 1960, max: 2030 } }
|
|
22
|
+
VALIDATION_RULES = { 'country' => { type: 'string', required: true, min_length: 2, max_length: 2 }, '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_inflation.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: apiverve_inflation
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- APIVerve
|
|
@@ -60,7 +60,8 @@ dependencies:
|
|
|
60
60
|
description: Inflation Rate reports annual inflation rates and Consumer Price Index
|
|
61
61
|
(CPI) values for any country by two-letter country code. Outputs include the year-over-year
|
|
62
62
|
price change percentage, CPI index, and base comparison year, with paid plans supporting
|
|
63
|
-
historical lookups by year.
|
|
63
|
+
historical lookups by year. On paid plans, changes=true adds the prior year's rate
|
|
64
|
+
and the change from it, plus the 5-year average, high, low and cumulative CPI rise.
|
|
64
65
|
email:
|
|
65
66
|
- hello@apiverve.com
|
|
66
67
|
executables: []
|