| Crates.io | exchange-rs |
| lib.rs | exchange-rs |
| version | 0.1.1 |
| created_at | 2024-12-13 16:47:20.935994+00 |
| updated_at | 2024-12-13 16:47:20.935994+00 |
| description | Command-line tool to fetch data from stock exchanges. |
| homepage | https://github.com/luizvbo/exchange-rs |
| repository | |
| max_upload_size | |
| id | 1482346 |
| size | 73,259 |
Exchange-rs is a command-line application written in Rust. It fetches real-time trading data from multiple exchanges and outputs it in a customizable format. This can be particularly useful for financial analysis, algorithmic trading, and other applications that require real-time stock market data.
The source code for Exchange-rs is hosted on GitHub. You can clone or fork the repository from the following URL:
https://github.com/luizvbo/exchange-rs
To install Exchange-rs, you need to have Rust installed on your machine. If you don't have Rust installed, you can install it using rustup.
Once you have Rust installed, you can clone the Exchange-rs repository and build the application using Cargo, Rust's package manager. Here are the steps:
git clone https://github.com/luizvbo/exchange-rs.git
cd exchange-rs
cargo build --release
The executable will be located in the target/release directory.
You can run Exchange-rs from the terminal with the following command:
./target/release/exchange-rs <ISIN> [<FORMAT>]
ISIN: The ISIN of the instrument to fetch data for. This is required and
should follow the format {ISIN}-XAMS (e.g., IE00B4L5Y983-XAMS).
FORMAT (optional): A custom output format string that defines how the
data is displayed. The default format is: "%p | Open: %o (%O) | Close: %c (%C)"
You can use the following placeholders in the format string:
%p: The price.%o: The value since open.%O: The percentage change since open.%c: The value since close.%C: The percentage change since close.For example, to customize the output to show only the price and open percentage, you can use the following format:
./target/release/exchange-rs IE00B4L5Y983-XAMS "%p - %O"
./target/release/exchange-rs IE00B4L5Y983-XAMS
This will fetch the data for the instrument with the specified ISIN and print it in the default format.
For example, the output could look like:
123.45 | Open: 120.00 (2.5%) | Close: 121.00 (1.9%)
./target/release/exchange-rs IE00B4L5Y983-XAMS "%p | Open: %o | Change: %O"
This will print something like:
123.45 | Open: 120.00 | Change: 2.5%
Contributions to Exchange-rs are welcome! Please feel free to open an issue or submit a pull request on GitHub.
FORMAT argument that
allows users to specify custom output formatting.