11 个不稳定版本
新版本 0.6.1 | 2024 年 8 月 20 日 |
---|---|
0.6.0 | 2024 年 6 月 4 日 |
0.5.2 | 2024 年 3 月 12 日 |
0.5.1 | 2023 年 11 月 16 日 |
0.2.0 | 2023 年 3 月 30 日 |
1097 在 命令行工具 中排名
每月 581 次下载
115KB
2.5K SLoC
OCPI 收费 CLI
此 crate 提供了一个用于与 OCPI 收费 进行计算的二进制文件。具体适用于 OCPI 2.2.1
和 OCPI 2.1.1
版本。
安装
首先安装 Rust,然后安装 OCPI 收费命令行工具
cargo install ocpi-tariffs-cli
用法
可以直接使用 ocpi-tariffs
执行二进制文件。使用 ocpi-tariffs --help
查看子命令列表。
子命令
分析
要为收费和 CDR (充电详细记录) 定价,并查看单独期间的分解,请使用 analyze
Analyze a given charge detail record (CDR) against either a provided tariff
structure or a tariff that is contained in the CDR itself.
This command will show you a breakdown of all the calculated costs.
Usage: ocpi-tariffs analyze [OPTIONS]
Options:
-c, --cdr <CDR>
A path to the charge detail record in json format.
If no path is provided the CDR is read from standard in.
-t, --tariff <TARIFF>
A path to the tariff structure in json format.
If no path is provided, then the tariff is inferred to be contained
inside the provided CDR. If the CDR contains multiple tariff
structures, the first valid tariff will be used.
-o, --ocpi-version <OCPI_VERSION>
The OCPI version that should be used for the input structures.
If the input consists of version 2.1.1 structures they will be converted to 2.2.1 structures.
The actual calculation and output will always be according to OCPI 2.2.1.
use `detect` to let to tool try to find the matching version.
[default: v221]
[possible values: v221, v211, detect]
-z, --timezone <TIMEZONE>
Timezone for evaluating any local times contained in the tariff
structure
[default: Europe/Amsterdam]
-h, --help
Print help (see a summary with '-h')
验证
要为收费和 CDR 定价并检查计算结果是否与原始 CDR 不同,请使用 validate
Validate a given charge detail record (CDR) against either a provided tariff
structure or a tariff that is contained in the CDR itself.
This command will show the differences between the calculated totals and the
totals contained in the provided CDR.
Usage: ocpi-tariffs validate [OPTIONS]
Options:
-c, --cdr <CDR>
A path to the charge detail record in json format.
If no path is provided the CDR is read from standard in.
-t, --tariff <TARIFF>
A path to the tariff structure in json format.
If no path is provided, then the tariff is inferred to be contained
inside the provided CDR. If the CDR contains multiple tariff
structures, the first valid tariff will be used.
-z, --timezone <TIMEZONE>
Timezone for evaluating any local times contained in the tariff
structure
[default: Europe/Amsterdam]
-o, --ocpi-version <OCPI_VERSION>
The OCPI version that should be used for the input structures.
If the input consists of version 2.1.1 structures they will be converted to 2.2.1 structures.
The actual calculation and output will always be according to OCPI 2.2.1.
use `detect` to let to tool try to find the matching version.
[default: v221]
[possible values: v221, v211, detect]
-h, --help
Print help (see a summary with '-h')
依赖关系
~5–14MB
~150K SLoC