Skip to content

Commit 9ff6190

Browse files
authored
Update README.md
1 parent c1d20c5 commit 9ff6190

1 file changed

Lines changed: 41 additions & 20 deletions

File tree

README.md

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
1-
# cli-candlestick-chart
1+
<div align="center">
2+
<img src="https://i.imgur.com/dxLBSkD.png" />
3+
<br/>
4+
<br/>
5+
<b>Draw candlesticks charts right into your terminal.</b>
6+
<br/>
7+
<br/>
8+
<a href="https://github.com/Julien-R44/cli-candlestick-chart/actions/workflows/rust.yml">
9+
<img src="https://github.com/Julien-R44/cli-candlestick-chart/actions/workflows/rust.yml/badge.svg?branch=main" />
10+
</a>
11+
<a href="https://crates.io/crates/cli-candlestick-chart">
12+
<img src="https://img.shields.io/crates/v/cli-candlestick-chart.svg" />
13+
</a>
14+
<img src="https://img.shields.io/crates/l/cli-candlestick-chart.svg">
15+
<br/>
16+
<br/>
17+
</div>
218

3-
[![CI](https://github.com/Julien-R44/cli-candlestick-chart/actions/workflows/rust.yml/badge.svg?branch=main)](https://github.com/Julien-R44/cli-candlestick-chart/actions/workflows/rust.yml)
4-
[![Latest version](https://img.shields.io/crates/v/cli-candlestick-chart.svg)](https://crates.io/crates/cli-candlestick-chart)
519

6-
This library allows you to display candle charts directly in your terminal.
7-
8-
I did this project mainly to learn Rust, so the code may be not very good at some places.
9-
10-
![](https://raw.githubusercontent.com/Julien-R44/cli-candlestick-chart/main/docs/capture.png)
1120
![](https://raw.githubusercontent.com/Julien-R44/cli-candlestick-chart/main/docs/capture2.png)
1221

13-
# Table of contents
1422
* [Features](#features)
1523
* [API Usage](#api-usage)
1624
* [Binary Usage](#binary-usage)
@@ -25,7 +33,7 @@ I did this project mainly to learn Rust, so the code may be not very good at som
2533
Add this to your `Cargo.toml`
2634
```toml
2735
[dependencies]
28-
cli-candlestick-chart = "0.1"
36+
cli-candlestick-chart = "0.2"
2937
```
3038

3139
```rust
@@ -42,7 +50,7 @@ fn main() {
4250
];
4351

4452
// Create and display the chart
45-
let mut chart = Chart::new(candles);
53+
let mut chart = Chart::new(&candles);
4654

4755
// Set the chart title
4856
chart.set_name(String::from("BTC/USDT"));
@@ -56,6 +64,8 @@ fn main() {
5664
```
5765

5866
# Binary Usage
67+
68+
5969
```
6070
USAGE:
6171
cli-candlestick-chart.exe [OPTIONS]
@@ -72,16 +82,26 @@ OPTIONS:
7282
-r, --reading-mode <READING_MODE> Choose your reading mode.
7383
[possible values: stdin, csv-file, json-file]
7484
```
85+
When requesting the CSV file mode, the library expects a CSV file with `open,high,low,close` headers fields.
7586

76-
# Examples
77-
## Api
78-
- [Basic example with CSV parsing](https://github.com/Julien-R44/cli-candlestick-chart/blob/main/examples/basic-with-csv-parsing.rs)
79-
80-
`cargo run --example basic-with-csv-parsing --features=serde`
87+
When requesting the JSON or stdin mode, the library expects a JSON with the following format :
88+
```
89+
[
90+
{
91+
"open": 28994.009766,
92+
"high": 29600.626953,
93+
"low": 28803.585938,
94+
"close": 29374.152344
95+
},
96+
...
97+
]
98+
```
8199

82-
- [Fetch candles from binance](https://github.com/Julien-R44/cli-candlestick-chart/blob/main/examples/fetch-from-binance.rs)
100+
# Examples
101+
## API
102+
[Basic example with CSV parsing](https://github.com/Julien-R44/cli-candlestick-chart/blob/main/examples/basic-with-csv-parsing.rs) : Run with `cargo run --example basic-with-csv-parsing --features=serde`
83103

84-
`cargo run --example fetch-from-binance --features=serde`
104+
[Fetch candles from binance](https://github.com/Julien-R44/cli-candlestick-chart/blob/main/examples/fetch-from-binance.rs) : Run with `cargo run --example fetch-from-binance --features=serde`
85105

86106
## Binary
87107
- Read CSV from file :
@@ -109,8 +129,9 @@ echo '[
109129
"low": 29091.181641,
110130
"close": 32127.267578
111131
}
112-
]' | ./cli-candlestick-chart -r=stdin \
132+
]' | ./cli-candlestick-chart \
133+
-r=stdin \
113134
--chart-name="My BTC Chart" \
114135
--bear-color="#b967ff" \
115136
--bull-color="ff6b99"
116-
```
137+
```

0 commit comments

Comments
 (0)