Giter Site home page Giter Site logo

forx's Introduction

ForX - get forex quotes from the terminal

Downloads GitHub code size in bytes PyPI

forx is a command line tool for checking exchange rates between currencies, both crypto and fiat.

forx-demo

Features

  • Conversions between all major world currencies.
  • Supports major cryptocurrencies, exchange rates via Coinbase's API
  • Formatted output and raw output
  • Convert different quantities of currency

Dependencies

Python 3.6 or above.

Installation

AUR

For archlinux based systems, forx is available on the AUR. Install it with your favorite AUR helper. Example using yay:

yay -S forx

PyPI

forx is also available as a python package. Simply install using pip:

pip install forx

Usage

Here are some examples of using forx:

forx btc usd # Price of 1 BTC in USD
forx btc usd -q 2 # Price of 2 BTC in USD
forx cny usd -f # Price of 1 CNY in USD, with no formatting

Donate

I develop forx for free in my spare time. If you like it, and want to buy me a coffee, I'd really appreciate it.

Donate: https://www.buymeacoffee.com/Gbox4

Bitcoin: (QR) bc1qusuztegpfuh7jk25l2dx5xyjvasgryrqg42d5n

Monero: (QR) 87wuCKbbchKV8Dz3JRoSN3jaqWBSiEShFXkFrYUaKT8Bew4P7dFvUJWVVR6RLr84J44QCdtNVyR6QC7aCSKYUWfnGK9y4K2

forx's People

Contributors

gbox4 avatar joshskidmore avatar zefr0x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

forx's Issues

Bypass cloudflare when using proxy

I tried to use an environmental proxy to connect via the Tor network, but it seems that python-requests doesn't bypass cloudflare since I got an error. I tried with the tor browser and it works.

I think that this should be solvable by modifing the http headers.

Various cryptocurrency return "Invalid currency"

Attempting to convert coins such as XMR, BNB, SAND, NEAR, KLAY, etc return "Invalid currency ." error, I have confirmed these are the names used for these coins on the Coinbase website.

Steps To Reproduce:

  1. Attempt to convert failing coin - forx XMR USD

2022-01-24_15-24
2022-01-24_15-26

It's possible this isn't an issue with your application and is instead an issue with the coinbase API. Further testing indicates that lower ranked coins past the 2nd page seem to all fail.

Some currencies need special rounding

Most currencies uses two decimal places, but some of them use more or less. For example: BHD uses three.

The decimal places needed for every fiat currency are available in the currencies data provided by #8. For crypto currencies I think that we shouldn't round the price, we should display the price as it is. It there any other idea?

Switch amount data type from int to float?

Currently, forx does't support amounts that aren't whole integers. For instance, forx btc usd -q .12 returns forx: error: argument -q: invalid int value: '.12'. Changing the type from int to float on line 72 in convert.py seems to resolve the issue, but I'm unsure of repercussions. I'm more than happy to submit a PR for this as well.

KeyError is thrown if currency's symbol doesn't exist in currency_symbols

❯ forx -q 10 usd sol
Traceback (most recent call last):
  File "/usr/bin/forx", line 33, in <module>
    sys.exit(load_entry_point('forx==1.0.1', 'console_scripts', 'forx')())
  File "/usr/lib/python3.10/site-packages/forx/convert.py", line 117, in main
    if currency_symbols[to.upper()]:
KeyError: 'SOL'

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.