1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//! # `wbi_rs`
//!
//! A lightweight **Rust library + CLI** to fetch, store, visualize, and summarize
//! [World Bank Indicators API](https://datahelpdesk.worldbank.org/knowledgebase/articles/889392-about-the-indicators-api-documentation)
//! data.
//!
//! ## Highlights
//! - Synchronous API client (`api::Client`)
//! - Tidy data model (`models::DataPoint`)
//! - Summary stats (`stats::grouped_summary`)
//! - CSV/JSON export (`storage`)
//! - SVG/PNG charts (`viz`) with legend placement, locale formatting, and multiple plot types
//!
//! ## Feature flags
//! - `online`: enables live API tests/examples. (The library itself works without it.)
//!
//! Country-consistent styling is available as a runtime option via `viz::plot_chart(.., Some(true))` or the CLI `--country-styles` flag.
//!
//! ## Quick example
//! ```no_run
//! use wbi_rs::{Client, DateSpec};
//! use wbi_rs::viz::{LegendMode, PlotKind};
//!
//! // 1) Fetch observations
//! let client = Client::default();
//! let data = client.fetch(
//! &["DEU".into(), "USA".into()],
//! &["SP.POP.TOTL".into()],
//! Some(DateSpec::Range { start: 2010, end: 2020 }),
//! None,
//! )?;
//!
//! // 2) Plot to SVG (line chart, legend on the right, English locale)
//! wbi_rs::viz::plot_chart(
//! &data,
//! "pop.svg",
//! 1000,
//! 600,
//! "en",
//! LegendMode::Right,
//! "Population (2010–2020)",
//! PlotKind::Line,
//! 0.3, // loess_span (ignored unless PlotKind::Loess)
//! None, // no country styles in tests
//! )?;
//!
//! // 3) Print grouped summary stats
//! let summaries = wbi_rs::stats::grouped_summary(&data);
//! for s in summaries {
//! println!("{:?}", s);
//! }
//! # Ok::<(), anyhow::Error>(())
//! ```
// Country-consistent styling module (always available)
pub use Client;
pub use ;