Giter Site home page Giter Site logo

forx's Issues

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'

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.

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?

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.

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.

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.