4个版本 (2个破坏性更新)
0.4.0 | 2021年2月8日 |
---|---|
0.3.0 | 2018年11月4日 |
0.2.1 |
|
0.1.1 | 2018年10月15日 |
0.1.0 | 2018年9月29日 |
#15 in #reports
每月29次下载
25KB
611 行
此库公开了两个公共函数,这些函数接受Google Analytics Core Reporting v4响应字符串(JSON数据的字符串)并将数据转换为更易于使用的形式。
将报告转换为分隔数据(例如TSV、CSV)
to_delimited(raw_report_response: &str,delimiter: &str) -> Result<Vec<String>, serde_json::Error>
将报告响应转换为分隔报告的集合。您可以指定任何分隔字符串。
["\"ga:deviceCategory\",\"ga:sessions\"\n\"desktop\",43\n\"mobile\",1\n"]
将报告转换为平面JSON(行数据的平面数组)
to_flat_json(raw_report: &str) -> Result<serde_json::value::Value,serde_json::Error>
将报告响应转换为平面JSON响应的数组。
[
[{
"ga:deviceCategory": "desktop",
"ga:sessions": 21
}, {
"ga:deviceCategory": "mobile",
"ga:sessions": 84
}],
[{
"ga:country": "Mexico",
"ga:bounces": 9213
}, {
"ga:country": "Canada",
"ga:bounces": 407
}]
]
限制
- 数据透视不受支持
贡献
欢迎问题和拉取请求。请保持友好。
- 使用
cargo test
运行测试 - 使用
cargo bench
运行基准测试 - 使用
rustfmt
格式化
许可
依赖项
~1–1.9MB
~41K SLoC