7 个版本
0.1.6 | 2024 年 5 月 19 日 |
---|---|
0.1.5 | 2024 年 2 月 4 日 |
0.1.4 | 2023 年 12 月 6 日 |
0.1.3 | 2023 年 11 月 14 日 |
0.1.0 | 2023 年 10 月 29 日 |
在 认证 中排名 #179
每月 118 次下载
65KB
1.5K SLoC
Zrsclient
Warning: This SDK is in active development. Please do not use for live trading
zrsclient 是为了创建一个基于 Rust 的 SDK,用于印度股票经纪商 Zerodha 提供的 API 而做的努力。我们努力积极维护此 SDK,以跟踪 Zerodha 对其 API 所做的更改。
我们还包括了重试机制来处理 REST API 的节流请求,以减轻算法编写者处理可恢复错误的非必要恐慌的痛苦。
示例
use zrsclient::connect::KiteConnect
use zrsclient::config::ZrsClientConfig
use serde_json::{Value as JsonValue};
// Create a config struct with proper authorization keys
let config = ZrsClientConfig {
api_key : Some("API_KEY"),
access_token : Some("ACCESS_TOKEN"),
base_url : None
}
// Create a KiteConnect client with config struct
let kite = KiteConnect::new(config);
// Set a count on how many times you want zrsclient to retry before panicking.
// If you set the retry count to 0 the client will not perform any retries on recoverable failures.
let retry_count_from_recoverable_errors = 10;
let data: Value = kite.holdings(retry_count_from_recoverable_errors);
运行集成测试
要运行不可变的集成测试,请运行以下命令
cargo test immutable -- --ignored
运行带统计信息的测试
运行以下命令以安装夜间编译器
rustup install nightly
运行以下命令将夜间编译器设置为默认编译器
rustup default nightly
要运行不可变的单元和集成测试,并获取指标
cargo test -- -Z unstable-options --report-time
依赖项
~9–21MB
~329K SLoC