{"id":13580403,"url":"https://github.com/Julien-R44/cli-candlestick-chart","last_synced_at":"2025-04-06T02:31:29.800Z","repository":{"id":43599131,"uuid":"427176454","full_name":"Julien-R44/cli-candlestick-chart","owner":"Julien-R44","description":"📈 Display candlestick charts right into your terminal.","archived":false,"fork":false,"pushed_at":"2022-11-29T07:49:25.000Z","size":155,"stargazers_count":249,"open_issues_count":4,"forks_count":21,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-08-09T21:32:12.394Z","etag":null,"topics":["candlestick-chart","cli","cryptocurrency","financial","rust","terminal","trading"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Julien-R44.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["Julien-R44"]}},"created_at":"2021-11-11T23:50:34.000Z","updated_at":"2024-08-08T15:34:37.000Z","dependencies_parsed_at":"2023-01-21T17:18:11.291Z","dependency_job_id":null,"html_url":"https://github.com/Julien-R44/cli-candlestick-chart","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julien-R44%2Fcli-candlestick-chart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julien-R44%2Fcli-candlestick-chart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julien-R44%2Fcli-candlestick-chart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julien-R44%2Fcli-candlestick-chart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Julien-R44","download_url":"https://codeload.github.com/Julien-R44/cli-candlestick-chart/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276189,"owners_count":20912288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["candlestick-chart","cli","cryptocurrency","financial","rust","terminal","trading"],"created_at":"2024-08-01T15:01:50.723Z","updated_at":"2025-04-06T02:31:29.774Z","avatar_url":"https://github.com/Julien-R44.png","language":"Rust","funding_links":["https://github.com/sponsors/Julien-R44"],"categories":["Rust"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://i.imgur.com/4HvhY8r.png\" /\u003e\n    \u003cbr/\u003e\n    \u003cbr/\u003e\n    \u003cb\u003eDraw candlesticks charts right into your terminal. 📈\u003c/b\u003e\n    \u003cbr/\u003e\n    \u003cbr/\u003e\n    \u003ca href=\"https://github.com/Julien-R44/cli-candlestick-chart/actions/workflows/rust.yml\"\u003e\n        \u003cimg src=\"https://github.com/Julien-R44/cli-candlestick-chart/actions/workflows/rust.yml/badge.svg?branch=main\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://docs.rs/cli-candlestick-chart\"\u003e\n         \u003cimg src=\"https://img.shields.io/docsrs/cli-candlestick-chart\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://crates.io/crates/cli-candlestick-chart\"\u003e\n        \u003cimg src=\"https://img.shields.io/crates/v/cli-candlestick-chart.svg\" /\u003e\n    \u003c/a\u003e\n    \u003cimg src=\"https://img.shields.io/crates/l/cli-candlestick-chart.svg\"\u003e\n    \u003cbr/\u003e\n    \u003cbr/\u003e\n\u003c/div\u003e\n\n\n![](https://i.imgur.com/J970jfL.png)\n\n* [Features](#features)\n* [API Usage](#api-usage)\n* [Binary Usage](#binary-usage)\n* [Examples](#examples)\n\n# Features\n- Customizable\n- Auto-fit to terminal size\n- Shipped as library with simple API\n- Shipped as binary for standalone usage\n\n# API Usage\nAdd this to your `Cargo.toml`\n```toml\n[dependencies]\ncli-candlestick-chart = \"0.3\"\n```\n\n```rust\nuse cli_candlestick_chart::{Candle, Chart};\n\nfn main() {\n    // Add some candles\n    let candles: Vec\u003cCandle\u003e = vec![\n        Candle::new(133.520004, 133.610001, 126.760002, 129.410004),\n        Candle::new(128.889999, 131.740005, 128.429993, 131.009995),\n        Candle::new(127.720001, 131.050003, 126.379997, 126.599998),\n        Candle::new(128.360001, 131.630005, 127.860001, 130.919998),\n        Candle::new(132.429993, 132.630005, 130.229996, 132.050003),\n    ];\n\n    // Create and display the chart\n    let mut chart = Chart::new(\u0026candles);\n\n    // Set the chart title\n    chart.set_name(String::from(\"BTC/USDT\"));\n\n    // Set customs colors\n    chart.set_bear_color(1, 205, 254);\n    chart.set_bull_color(255, 107, 153);\n    chart.set_vol_bull_color(1, 205, 254);\n    chart.set_vol_bear_color(255, 107, 153);\n\n    chart.set_volume_pane_height(6);\n    chart.set_volume_pane_enabled(false);\n    \n    chart.draw();\n}\n```\n\n# Binary Usage\nDownload the latest release for your platform [here](https://github.com/Julien-R44/cli-candlestick-chart/releases)\n\n```\nUSAGE:\n    cli-candlestick-chart.exe [OPTIONS] --mode \u003cMODE\u003e\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n        --bear-color \u003cBEAR_COLOR\u003e    Sets the descending candles color in hexadecimal.\n        --bull-color \u003cBULL_COLOR\u003e    Sets the ascending candles color in hexadecimal.\n        --chart-name \u003cCHART_NAME\u003e    Sets the chart name.\n    -f, --file \u003cFILE\u003e                [MODE:*-file] File to read candles from.`   \n    -m, --mode \u003cMODE\u003e                Select the method for retrieving the candles. \n                                     [possible values: stdin, csv-file, json-file]\n```\nWhen requesting the CSV file mode, the library expects a CSV file with `open,high,low,close` headers fields.\n\nWhen requesting the JSON or stdin mode, the library expects a JSON with the following format : \n```\n[\n  {\n    \"open\": 28994.009766,\n    \"high\": 29600.626953,\n    \"low\": 28803.585938,\n    \"close\": 29374.152344,\n    \"volume\": 13456 // Optional \n  },\n  ...\n]\n```\n\n# Examples\n## API \n[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,csv`\n\n[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,reqwest`\n\n## Binary \n- Read CSV from file :\n```bash\n./cli-candlestick-chart \\\n    --mode=csv-file \\\n    -f=./examples/BTC-USD.csv \\\n    --chart-name=\"My BTC Chart\" \\\n    --bear-color=\"#b967ff\" \\\n    --bull-color=\"ff6b99\"\n```\n\n- Read from stdin :\n```bash\necho '[\n  {\n    \"open\": 28994.009766,\n    \"high\": 29600.626953,\n    \"low\": 28803.585938,\n    \"close\": 29374.152344\n  },\n  {\n    \"open\": 29376.455078,\n    \"high\": 33155.117188,\n    \"low\": 29091.181641,\n    \"close\": 32127.267578\n  }\n]' | ./cli-candlestick-chart \\\n    --mode=stdin \\\n    --chart-name=\"My BTC Chart\" \\\n    --bear-color=\"#b967ff\" \\\n    --bull-color=\"ff6b99\"\n```\n\n## Other versions\n\nIf you prefer Python, there is a port of the library, developed by [BoboTiG](https://github.com/BoboTiG), right there : https://github.com/BoboTiG/py-candlestick-chart\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJulien-R44%2Fcli-candlestick-chart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJulien-R44%2Fcli-candlestick-chart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJulien-R44%2Fcli-candlestick-chart/lists"}