Working on fn cpi_included().
[?]
Apr 11, 2021, 12:42 PM
5POF332LJEBGWEJUGI34P33Q4BQP7CAQNV5ODQT3PWG7FI7VNLOQCDependencies
Change contents
- edit in src/main.rs at line 1
use std::fs; - edit in src/main.rs at line 5
inflation_series, - replacement in src/main.rs at line 7
unemployment_data,data,cpi_included, - edit in src/main.rs at line 10
use fred_api::Fred; - replacement in src/main.rs at line 13
// unemployment_series(Country::Slovenia);// let data = unemployment_series(Country::Slovenia); - replacement in src/main.rs at line 15
let s = unemployment_data("LRUNTTTTSIQ156S");println!("{}", s);// let u = unemployment_data("LRUNTTTTSIQ156S");// inflation_series(Country::Slovenia);// let data = data("SVNCPHPLA01GPM");// fs::write("SVNCPHPLA01GPM.csv", &data);// println!("{:?}", data);// for i in 0..=6 {// println!("{}\n{}", i, Fred::category(i));// }// for i in 9..=13 {// println!("{}\n{}", i, Fred::category(i));// }// for i in 15..=18 {// println!("{}\n{}", i, Fred::category(i));// }// for i in 21..=24 {// println!("{}\n{}", i, Fred::category(i));// }// for i in 25..=26 {// println!("{}\n{}", i, Fred::category(i));// }// for i in 28..=31 {// println!("{}\n{}", i, Fred::category(i));// }// Up to 38// Consumer Price Indices// println!("{}", Fred::category_series(9));// Use this to get related tags// JPNCPIALLMINMEI// println!("{}", Fred::series_tags("JPNCPIALLMINMEI"));// "price index"// "cpi"// println!("{}", Fred::tags_series("cpi;united kingdom"));println!("{}", cpi_included(Country::Sweden)); - edit in src/lib.rs at line 29
.for_each(|(i, s)| println!("{}\n{}", i, s));}pub fn unemployment_tags(country: Country) {let tags = Fred::tags_series(&format!("unemployment;{}",country,));println!("{}", tags);}pub fn inflation_series(country: Country) {let tags = Fred::tags_series(&format!("inflation;{}",country.to_string().to_lowercase(),));let seriess = tags.seriess;seriess.iter().enumerate() - replacement in src/lib.rs at line 52
/// unemployment_data("LRUNTTTTSIQ156S");/// data("LRUNTTTTSIQ156S"); - replacement in src/lib.rs at line 54
pub fn unemployment_data(series_id: &str) -> String {pub fn data(series_id: &str) -> String { - edit in src/lib.rs at line 65
}pub fn cpi_included(country: Country) -> String {match country {Country::Australia => {Fred::tags_series(&to_cpi_tag(country)).series_titles()// "Consumer Price Index: All items: Total: Total for Australia"// "Consumer Price Index: All Items for Australia"// "Consumer Price Index in Australia (DISCONTINUED)"// "Consumer Price Index: Total All Items for Australia"// "Consumer Price Index for Australia"// "Inflation, consumer prices for Australia"}Country::Austria => {Fred::tags_series(&to_cpi_tag(country)).series_titles()// "Consumer Price Index for Austria"// "Consumer Price Index: All items: Total: Total for Austria"// "Consumer Price Index: All Items for Austria"// "Consumer Price Index in Austria (DISCONTINUED)"// "Consumer Price Index: Harmonized Prices: Total All Items for Austria"// "Consumer Price Index: Harmonized Prices: Total All Items for Austria // (DISCONTINUED)"// "Consumer Price Index: Total All Items for Austria"// "Harmonized Index of Consumer Prices: All Items for Austria"// "Harmonized Index of Consumer Prices in Austria (DISCONTINUED)"// "Inflation, consumer prices for Austria"// "Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for // Austria"// "Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for Austria (DISCONTINUED)"}Country::Belgium => {Fred::tags_series(&to_cpi_tag(country)).series_titles()// Consumer Price Index for Belgium// Consumer Price Index: Harmonized Prices: Total All Items for Belgium// Consumer Price Index: Harmonized Prices: Total All Items for Belgium (DISCONTINUED)// Consumer Price Index: Total All Items for Belgium// Harmonized Index of Consumer Prices: All Items for Belgium// Harmonized Index of Consumer Prices in Belgium (DISCONTINUED)// Consumer Price Index: All Items for Belgium// Consumer Price Index in Belgium (DISCONTINUED)// Consumer Price Index: All items: Total: Total for Belgium}Country::Canada => {Fred::tags_series(&to_cpi_tag(country)).series_titles()// Inflation, consumer prices for Canada// Consumer Price Index for Canada// Consumer Price Index: Total All Items for Canada// Consumer Price Index in Canada (DISCONTINUED)// Consumer Price Index of All Items in Canada// Consumer Price Index: All items: Total: Total for Canada}Country::Chile => {Fred::tags_series(&to_cpi_tag(country)).series_titles()// Consumer Price Index for Chile// Inflation, consumer prices for Chile// Consumer Price Index: Total All Items for Chile// Consumer Price Index: All Items for Chile// Consumer Price Index: All items: Total: Total for Chile}Country::CzechRepublic => {Fred::tags_series(&to_cpi_tag(country)).series_titles()// Consumer Price Index for Czech Republic// Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for Czech Republic// Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for Czech Republic (DISCONTINUED)// Consumer Price Index: All Items for Czech Republic// Consumer Price Index: All items: Total: Total for the Czech Republic// Consumer Price Index: Harmonized Prices: Total All Items for the Czech Republic// Consumer Price Index: Harmonized Prices: Total All Items for the Czech Republic (DISCONTINUED)// Consumer Price Index: Total All Items for the Czech Republic// Harmonized Index of Consumer Prices: All Items for Czech Republic}Country::France => {Fred::tags_series(&to_cpi_tag(country)).series_titles()// Harmonized Index of Consumer Prices in France (DISCONTINUED)// Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for France (DISCONTINUED)// Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for France// Consumer Price Index in France (DISCONTINUED)// Consumer Price Index of All Items in France// Consumer Price Index: All items: Total: Total for France// Inflation, consumer prices for France// Consumer Price Index for France// Consumer Price Index: Harmonized Prices: Total All Items for France (DISCONTINUED)// Consumer Price Index: Harmonized Prices: Total All Items for France// Consumer Price Index: Total All Items for France}Country::Germany => {Fred::tags_series(&to_cpi_tag(country)).series_titles()// Inflation, consumer prices for Germany// Harmonized Index of Consumer Prices in Germany (DISCONTINUED)// Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for Germany (DISCONTINUED)// Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for Germany// Consumer Price Index in Germany (DISCONTINUED)// Consumer Price Index of All Items in Germany// Consumer Price Index: All items: Total: Total for Germany// Consumer Price Index for Germany// Consumer Price Index: Harmonized Prices: Total All Items for Germany (DISCONTINUED)// Consumer Price Index: Harmonized Prices: Total All Items for Germany// Consumer Price Index: Total All Items for Germany// Harmonized Index of Consumer Prices: All Items for Germany (including former GDR from 1991)}Country::Greece => {Fred::tags_series(&to_cpi_tag(country)).series_titles()// Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for Greece// Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for Greece (DISCONTINUED)// Consumer Price Index: All Items for Greece// Consumer Price Index: All items: Total: Total for Greece// Inflation, consumer prices for Greece// Consumer Price Index for Greece// Consumer Price Index: Harmonized Prices: Total All Items for Greece// Consumer Price Index: Harmonized Prices: Total All Items for Greece (DISCONTINUED)// Consumer Price Index: Total All Items for Greece// Harmonized Index of Consumer Prices: All Items for Greece}Country::Italy => {Fred::tags_series(&to_cpi_tag(country)).series_titles()// Harmonized Index of Consumer Prices in Italy (DISCONTINUED)// Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for Italy (DISCONTINUED)// Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for Italy// Consumer Price Index: Food for Italy// Consumer Price Index in Italy (DISCONTINUED)// Consumer Price Index of All Items in Italy// Consumer Price Index: All items: Total: Total for Italy// Inflation, consumer prices for Italy// Consumer Price Index for Italy// Consumer Price Index: Harmonized Prices: Total All Items for Italy (DISCONTINUED)// Consumer Price Index: Harmonized Prices: Total All Items for Italy// Consumer Price Index: Total All Items for Italy// Harmonized Index of Consumer Prices: All Items for Italy}Country::Japan => {Fred::tags_series(&to_cpi_tag(country)).series_titles()// "Harmonized Index of Consumer Prices in Japan (DISCONTINUED)"// "Consumer Price Index in Japan (DISCONTINUED)"// "Consumer Price Index of All Items in Japan"// "Consumer Price Index: All items: Total: Total for Japan"// "Inflation, consumer prices for Japan"// "Not Seasonally Adjusted"}Country::Netherlands => {Fred::tags_series(&to_cpi_tag(country)).series_titles()// Harmonized Index of Consumer Prices in Netherlands (DISCONTINUED)// Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for Netherlands (DISCONTINUED)// Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for Netherlands// Consumer Price Index in Netherlands (DISCONTINUED)// Consumer Price Index: All Items for Netherlands// Consumer Price Index: All items: Total: Total for the Netherlands// Consumer Price Index for Netherlands// Consumer Price Index: Harmonized Prices: Total All Items for the Netherlands// Consumer Price Index: Harmonized Prices: Total All Items for the Netherlands (DISCONTINUED)// Consumer Price Index: Total All Items for the Netherlands// Harmonized Index of Consumer Prices: All Items for Netherlands}Country::Poland => {Fred::tags_series(&to_cpi_tag(country)).series_titles()// Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for Poland// Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for Poland (DISCONTINUED)// Consumer Price Index: Food for Poland// Consumer Price Index: All Items for Poland// Consumer Price Index: All items: Total: Total for Poland// Inflation, consumer prices for Poland// Consumer Price Index for Poland// Consumer Price Index: Total All Items for Poland// Harmonized Index of Consumer Prices: All Items for Poland}Country::SouthKorea => {Fred::tags_series(&to_cpi_tag(country)).series_titles()// deserialize error}Country::Spain => {Fred::tags_series(&to_cpi_tag(country)).series_titles()// Inflation, consumer prices for Spain// Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for Spain (DISCONTINUED)// Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for Spain// Consumer Price Index in Spain (DISCONTINUED)// Consumer Price Index: All Items for Spain// Consumer Price Index: All items: Total: Total for Spain// Consumer Price Index for Spain// Consumer Price Index: Harmonized Prices: Total All Items for Spain (DISCONTINUED)// Consumer Price Index: Harmonized Prices: Total All Items for Spain// Consumer Price Index: Total All Items for Spain// Harmonized Index of Consumer Prices: All Items for Spain}Country::Sweden => {Fred::tags_series(&to_cpi_tag(country)).series_titles()// Harmonized Index of Consumer Prices in Sweden (DISCONTINUED)// Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for Sweden// Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for Sweden (DISCONTINUED)// Consumer Price Index: All Items for Sweden// Consumer Price Index in Sweden (DISCONTINUED)// Consumer Price Index: All items: Total: Total for Sweden// Consumer Price Index: Harmonized Prices: Total All Items for Sweden// Consumer Price Index: Harmonized Prices: Total All Items for Sweden (DISCONTINUED)// Consumer Price Index for Sweden// Consumer Price Index: Total, Net All Items for Sweden (DISCONTINUED)// Consumer Price Index: Total All Items for Sweden// Harmonized Index of Consumer Prices: All Items for Sweden}Country::Taiwan => {Fred::tags_series(&to_cpi_tag(country)).to_string()// Two old data series only.}Country::UnitedKingdom => {Fred::tags_series(&to_cpi_tag(country)).series_titles()// Harmonized Index of Consumer Prices in the United Kingdom (DISCONTINUED)// Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for United Kingdom (DISCONTINUED)// Consumer Price Index: All Items (Harmonized Index of Consumer Prices) for United Kingdom// Consumer Price Index in the United Kingdom (DISCONTINUED)// Consumer Price Index of All Items in the United Kingdom// Consumer Price Index: All Items for United Kingdom// Consumer Price Index: All items: Total: Total for the United Kingdom// Inflation, consumer prices for the United Kingdom// Consumer Price Index for United Kingdom// Consumer Price Index in the United Kingdom// Consumer Price Inflation in the United Kingdom// Consumer Price Index: Harmonized Prices: Total All Items for the United Kingdom (DISCONTINUED)// Consumer Price Index: Harmonized Prices: Total All Items for the United Kingdom// Consumer Price Index: Total All Items for the United Kingdom// Harmonized Index of Consumer Prices: All Items for United Kingdom}Country::UnitedStates => {Fred::tags_series(&to_cpi_tag(country)).series_titles()// deserialize error}_ => panic!(),} - edit in src/lib.rs at line 326[2.1624]
fn to_cpi_tag(country: Country) -> String {format!("cpi;{}",country.to_string().to_lowercase())} - replacement in src/countries.rs at line 14
Japa,Japan, - replacement in src/countries.rs at line 260
Country::Japa => "Japa",Country::Japan => "Japan", - replacement in src/countries.rs at line 270
Country::UnitedKingdom => "UnitedKingdom",Country::UnitedKingdom => "United Kingdom", - replacement in src/countries.rs at line 276
Country::SouthKorea => "SouthKorea",Country::SouthKorea => "South Korea", - replacement in src/countries.rs at line 336
Country::CzechRepublic => "CzechRepublic",Country::CzechRepublic => "Czech Republic",