GithubHelp home page GithubHelp logo

michaeltintiuc / bnm-go Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 80 KB

a CLI tool for fetching official currency rates from the National Bank of Moldova

License: MIT License

Go 100.00%
golang go bnm moldova bank currency rates currency-rates conversion convert xml parser

bnm-go's Introduction

bnm-go

Build Status Go Report Card codecov

a CLI tool for fetching official currency rates from the National Bank of Moldova

Installation

go get github.com/michaeltintiuc/bnm-go

bnm-go preview

Usage

bnm-go -h

  -buy float
    	Calculate amount of MDL for each -c (currencies) bought
  -c value
    	Comma separated list of currencies to display (default [USD])
  -d string
    	Date format: {dd.mm.yyy} or {yesterday|yday|yd|yda} (default "24.02.2018")
  -f	Skip reading cache and fetch fresh data
  -h	Print usage
  -l string
    	Language: {en|md|ro|ru} (default "en")
  -sell float
    	Calculate amount of MDL for each -c (currencies) sold
  -v	Display verbose output
  -x	Cross reference rates to the day before -d

Produce verbose output

bnm-go -v

Fetch fresh data, skipping any cached files

bnm-go -f

Fetch rates and set output language to Russian (ru)

bnm-go -l=ru

Fetch USD and EUR rates for today

bnm-go -c=usd,eur

Alternate way of setting currencies

bnm-go -c=eur -c=cad -c=nzd

Fetch USD and EUR rates for yesterday

bnm-go -c=usd,eur -d=yd

Fetch USD and EUR rates for January 31st 20018

bnm-go -c=usd,eur -d=31.01.2018

Fetch USD and EUR rates and compare with values from yesterday or day prior to -d. The output will be display red, green and blue colors for drop, rise and unchanged respectively

bnm-go -c=usd,eur -x

Calculate amount of MDL received for selling 100 USD and EUR

bnm-go -c=usd,eur --sell=100

Calculate amount of USD and EUR received for 100 MDL

bnm-go -c=usd,eur --buy=100

TODO:

  • Caching
  • Argument parsing (date, currency)
  • Currency conversion
  • Cross reference rates from prior date for drop/rise (red/green) display
  • Tests
  • Docs

bnm-go's People

Contributors

michaeltintiuc avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.