Currency exchange rates in your terminal

Related tags

Command-line rates
Overview

Rates

Usage example Rates is a scriptable CLI tool that brings currency exchange rates right into your terminal and supports 30+ fiat and 10K+ crypto currencies.

Installation

Cargo

If you have Rust installed, you can get the binary by running:

cargo install rates

Releases

Alternatively, you can download a binary for your system from the releases page

TODO

  • Switch to Yahoo and Binance
  • Add tests
  • Add --period flag that takes a period e.g. day, week, month, quarter, year, max, etc. Defaults to 1 day.
  • Add --difference flag that return difference for a given period of time. Works only if --period is greater than 2 days.
  • Add --max and --min flags that return maximum and minimum value for a given period
  • Add --close, --adjusted-close, and --open that return close, adjusted close, or open value for a given period
  • Add aliaces for symbols, e.g. bitcoin = btc, gold = xau
  • (maybe) Add volume subcommand that:
    • By default, accepts one value and returns its volume if available.

License

Apache 2.0 or MIT, at your choice.

Comments
  • Problems with cargo build

    Problems with cargo build

    I cloned this git repository and ran cargo build, which gave me the following error.

    error[E0107]: wrong number of type arguments: expected 3, found 2
      --> /home/sudip/.cargo/registry/src/github.com-1ecc6299db9ec823/h2-0.3.0/src/proto/streams/store.rs:15:10
       |
    15 |     ids: IndexMap<StreamId, SlabIndex>,
       |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 type arguments
    
    error: aborting due to previous error
    
    For more information about this error, try `rustc --explain E0107`.
    error: could not compile `h2`
    

    I got the same error even when I had just this code inside main.rs

    fn main() -> Result<(), std::io::Error> {
        Ok(())
    }
    

    Output of rustc --version is rustc 1.50.0 (cb75ad5db 2021-02-10). I am learning Rust and I wanted to take this code apart as an exercise, not just install it as a command line tool (which I was able to do using cargo install).

    opened by cbjuju 3
  • popOS/ubuntu 20.10 does not work

    popOS/ubuntu 20.10 does not work

    infamous glibc :(

    I tried running the binary released on my [email protected]

    rates: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by rates)
    
    opened by tiero 3
  • Crashes for most options

    Crashes for most options

    $ rates --version
    rates 0.6.0
    $ RUST_BACKTRACE=full rates 1000 eur cad
    thread 'main' panicked at 'range end index 7 out of range for slice of length 6', /home/poboxy/.cargo/registry/src/github.com-1ecc6299db9ec823/rates-0.6.0/src/main.rs:311:18
    stack backtrace:
       0:     0x557b57d41b2c - std::backtrace_rs::backtrace::libunwind::trace::hb4a65d880d51cc8a
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
       1:     0x557b57d41b2c - std::backtrace_rs::backtrace::trace_unsynchronized::h7869122ac9e9e614
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
       2:     0x557b57d41b2c - std::sys_common::backtrace::_print_fmt::h9fff32a009da8160
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/sys_common/backtrace.rs:66:5
       3:     0x557b57d41b2c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h08e4d8f078954af6
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/sys_common/backtrace.rs:45:22
       4:     0x557b57d6671c - core::fmt::write::he3a8c04c34cff473
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/core/src/fmt/mod.rs:1190:17
       5:     0x557b57d3b578 - std::io::Write::write_fmt::h885fc3922042c55b
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/io/mod.rs:1657:15
       6:     0x557b57d43f87 - std::sys_common::backtrace::_print::h491ea87d9bc93a80
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/sys_common/backtrace.rs:48:5
       7:     0x557b57d43f87 - std::sys_common::backtrace::print::h172aa49b889b9de8
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/sys_common/backtrace.rs:35:9
       8:     0x557b57d43f87 - std::panicking::default_hook::{{closure}}::h4b688a609ed3ca6c
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/panicking.rs:295:22
       9:     0x557b57d43c4f - std::panicking::default_hook::hcea89d8776676158
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/panicking.rs:314:9
      10:     0x557b57d446ea - std::panicking::rust_panic_with_hook::hca08b43f72502df8
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/panicking.rs:698:17
      11:     0x557b57d443d7 - std::panicking::begin_panic_handler::{{closure}}::hdf2d4b6030b5dc90
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/panicking.rs:588:13
      12:     0x557b57d41fd4 - std::sys_common::backtrace::__rust_end_short_backtrace::hf3c1e0f8da5136c0
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/sys_common/backtrace.rs:138:18
      13:     0x557b57d440d9 - rust_begin_unwind
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/panicking.rs:584:5
      14:     0x557b57aa0993 - core::panicking::panic_fmt::hbb5a63c753f090ac
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/core/src/panicking.rs:143:14
      15:     0x557b57aa0b82 - core::slice::index::slice_end_index_len_fail::hd8f75f140e486160
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/core/src/slice/index.rs:43:5
      16:     0x557b57aa7314 - rates::main::h4cdf8afd6b6055c6
      17:     0x557b57aaf053 - std::sys_common::backtrace::__rust_begin_short_backtrace::h1816050783151935
      18:     0x557b57aaf979 - std::rt::lang_start::{{closure}}::hb93ed4ca311d2f83
      19:     0x557b57d41211 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h9f6c70c6863abb0b
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/core/src/ops/function.rs:259:13
      20:     0x557b57d41211 - std::panicking::try::do_call::hf6350c75b30bd0f1
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/panicking.rs:492:40
      21:     0x557b57d41211 - std::panicking::try::h67ba605f497cdfdc
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/panicking.rs:456:19
      22:     0x557b57d41211 - std::panic::catch_unwind::h4e6542438b3e71ec
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/panic.rs:137:14
      23:     0x557b57d41211 - std::rt::lang_start_internal::{{closure}}::hf98fc5d7a8caf36d
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/rt.rs:128:48
      24:     0x557b57d41211 - std::panicking::try::do_call::hc31d24a060ec9ed8
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/panicking.rs:492:40
      25:     0x557b57d41211 - std::panicking::try::h8b7f790d459c8fd4
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/panicking.rs:456:19
      26:     0x557b57d41211 - std::panic::catch_unwind::h3d80114f041a858e
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/panic.rs:137:14
      27:     0x557b57d41211 - std::rt::lang_start_internal::h6474f54d5a177436
                                   at /rustc/e646f3d2a9541952310778288854943678738ea9/library/std/src/rt.rs:128:20
      28:     0x557b57aa81c2 - main
      29:     0x7f4ebeb2d565 - __libc_start_main
      30:     0x557b57aa11ce - _start
      31:                0x0 - <unknown>
    $ echo $?
    101
    $ RUST_BACKTRACE=full rates 1000 eur cad -t
    1000 EUR = 1444 CAD
    $ echo $?
    0
    
    opened by zouhair 2
  • BTC rate is way off

    BTC rate is way off

    $ rates BTC USD
    1 BTC = 58820.7 USD
    

    This is way off. It's 44k now.

    Looking at https://api.coinranking.com/v2/coins - that part seems right. I didn't get deeper into the code though to see where the actual bug is.

    opened by ibz 1
  • small error in PKGBUILD

    small error in PKGBUILD

    There seems to be an error in the beginning of the PKGBUILD: "https://api.github.com/repos/rates/lunush/releases/latest" should be changed to: "https://api.github.com/repos/lunush/rates/releases/latest"

    opened by piotrruss 1
Releases(0.7.0)
Owner
Lunush
Web Developer. Artwork by pawel_czerwinski@unsplash.
Lunush
💱 A crusty currency converter

?? moneyman A crusty currency converter Example $ moneyman convert 50 --from EUR --to PHP --on 2023-05-06 --fallback 50 EUR -> 3044.5833333333350 PHP

SEKUN 6 May 22, 2023
Reference implementation of a decentralized exchange for custom instruments, risk, and fees

Dexterity What is Dexterity At a high level, Dexterity is a smart contract (or collection of smart contracts) that allow for the creation of a decentr

Solana Foundation 43 Dec 15, 2022
A minimal file exchange server designed for clients with browsers only.

XIAO-Files Xiao-Files is a minimal file exchange server designed for clients with browsers only. Example Let's say we have a host with IP 10.8.20.1, a

EvianZhang 3 Apr 2, 2024
ask.sh: AI terminal assistant that can read and write your terminal directly!

ask.sh: AI terminal assistant that read from & write to your terminal ask.sh is an AI terminal assistant based on OpenAI APIs such as GPT-3.5/4! What'

hmirin 5 Jun 20, 2023
Print your git contributions in your terminal, blazingly fast

Takoyaki Blazingly fast git contribution graph in your terminal Features ✔️ Customizable ✔️ Plugins to support a bunch of cloud based git repositories

kyeboard 13 Feb 6, 2023
Get your github contributions right in your terminal, blazingly fast!

GitColorScripts Get your github contributions right in your terminal! Installation Install via yay yay -S gitcolorscripts Install manually Download t

VoidCupboard 56 Jul 12, 2023
A terminal ASCII media player. View images, gifs, videos, webcam, YouTube, etc.. directly in the terminal as ASCII art.

Terminal Media Player View images, videos (files or YouTube links), webcam, etc directly in the terminal as ASCII. All images you see below are just m

Max Curzi 36 May 8, 2023
A simple and efficient terminal UI implementation with ratatui.rs for getting quick insights from csv files right on the terminal

CSV-GREP csv-grep is an intuitive TUI application writting with ratatui.rs for reading, viewing and quickly analysing csv files right on the terminal.

Anthony Ezeabasili 16 Mar 10, 2024
create and test the style and formatting of text in your terminal applications

description: create and test the style and formatting of text in your terminal applications docs: https://docs.rs/termstyle termstyle is a library tha

Rett Berg 18 Jul 3, 2021
Amp: A text editor for your terminal.

Amp: A text editor for your terminal. Heavily inspired by Vi/Vim. Amp aims to take the core interaction model of Vim, simplify it, and bundle in the e

Jordan MacDonald 3.3k Jan 3, 2023
yayagram - Play nonograms/picross in your terminal

yayagram is a puzzle game in which you fill out a grid with cells based on logic and number clues.

r00ster 32 Oct 8, 2022
Warp is a blazingly fast, Rust-based terminal that makes you and your team more productive at running, debugging, and deploying code and infrastructure.

Warp is a blazingly fast, Rust-based terminal that makes you and your team more productive at running, debugging, and deploying code and infrastructure.

Warp 10.4k Jan 4, 2023
Pokédex in your terminal, thanks to Rust

mon - a command line Pokédex Uses art from pokemon-colorscripts and Pokémon data from PokéAPI. Building Rust up! Tested on: > rustc --version rustc 1.

Damian 26 Apr 17, 2022
Display a random Shiba from your terminal whenever you feel the need to. Because why not?

Shiba CLI Command-line interface (CLI) to display a random Shiba Inu whenever needed, by just running shiba on your terminal. How To Use • How Does It

null 17 Sep 25, 2022
ADPlay (ASCII-Drip Play): Pics on your terminal

ADPlay ADPlay (ASCII-Drip play): Graphic content on your terminal (works better on pixel arts) Build Build bin and install dependencies: cargo build -

Sofiane H. Djerbi 26 Oct 7, 2022
Display candlestick chart in your terminal.

cli-candlestick-chart This module allows you to display candle charts directly in your terminal. I did this project mainly to learn Rust, so the code

Julien 178 Dec 18, 2022
Nazuna - 🐦 Download Twitter videos using your terminal!

Nazuna ?? Download Twitter videos using your terminal! Installation Binary Download the desired file for your OS (Windows, Mac, Linux) from https://gi

Felipe Garcia 27 Nov 22, 2022
The-way - A code snippets manager for your terminal.

The Way A code snippets manager for your terminal. Record and retrieve snippets you use every day, or once in a blue moon, without having to spin up a

OutOfCheeseError 254 Jan 7, 2023
🏝️ Set wallpaper from your terminal!

WLP Set wallpaper from your terminal. It works on Linux, Mac and Windows. Installation Manual git clone https://github.com/ahmadrosid/wlp.git cargo in

ahmadrosid 7 Dec 28, 2022