GithubHelp home page GithubHelp logo

kartmaan / currency_converter Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 92 KB

A currency converter also allowing to visualize the historical rates graph

Python 100.00%
currency-converter currency currencies currency-exchange-rates historical-data graph finance currency-pairs pyqt5 pyqtgraph pyperclip api free-currencyconverterapi-com finnhub-api

currency_converter's Introduction

Currency_converter

Currency_converter is a graphical interface designed with PyQt5 allows to convert currencies and view the rates history graph. Rates can be retrieved from two free APIs: free.currconv and finnhub.io.

The application is in the form of 3 tabs:

  • Options
  • Currency converter
  • Historical graph

What does the program do ?

Main window

  • A rectangle placed at the top left constantly displays the day of the week, the current date and time according to the format chosen by the user
  • A status message area at the bottom of the window

Option tab

  • The user can choose their API from a drop-down menu
  • For each API a key is proposed by default but it can be modified and saved
  • The API key displayed changes depending on the API selected in the drop-down menu
  • A 'TEST' button is used to check the validity of the inserted API key, if the API key is wrong, the program proposes to restore the previous one
  • The graph theme can be modified ('Light' or 'Dark')
  • User can choose to show grid on graph or not
  • The date and hour format can be modified
  • The 'Save all' button allows to save all the preferences in a JSON file, these preferences will be loaded directly the next time the application is started.

Currency Converter

  • The input field is checked to ensure that an integer or float number is inserted
  • Two drop-down menus allow to select the currencies
  • A 'swipe' button allows to reverse the currency pair
  • The 'convert' button converts the amount inserted using the API chosen by the user
  • An output area displays the converted value, this value can be directly selected by the cursor
  • Additional information area displayed at the bottom gives the conversion of one unit of the currency (ex : 1 EURO = 1.2 US Dollar), the area also displays the local name of the currency, its symbol as well as the date and time of the last update
  • A 'copy' button allows to directly copy the result obtained to the clipboard
  • A 'clear' button is used to clear the input field, the output area and the additional information area

Historical graph

  • Two drop-down menus allow to select the currencies
  • A 'swipe' button allows to reverse the currency pair
  • A 'VIEW' button allows to retrieve historical data from the API and represent it graphically
  • A graph frame showing the historical rate curve
  • The graph displays the rates on the y axis, the date on the x axis (according to the format chosen by the user) and a title displaying the selected currency pair and the start and end date of the measurement
  • A column on the right displays graph statistics (start / end date of the measurement, duration of the measurement, last rate, last variation, total variation, min / max / mean
  • A drop-down menu allow to select the range time of the measurement
  • The 'Save the graph' button allows to save the image of the graph in the current folder in .png format
  • The 'Copy rate value' copies the code of the chosen currency pairs, the dates (timestamps) and their corresponding rate to the clipboard in the form of a dictionary

Additional info

  • The data used to draw the graph of historical rates is only taken from free.currconv
  • A thread periodically analyzes the state of the Internet connection by connecting to the Google DNS, if a cut is noticed certain buttons launching processes requiring Internet will be disabled during the cut
  • Each time current tab change, the title at the top of the window changes to the name of the selected tab
  • The program retrieves the information regarding the name of currencies, their code, their local name, etc. from the currencies.json file (retrieved from https://gist.github.com/Fluidbyte/2973986)
  • Each time the application is started, the save.json file is loaded in order to apply the user's preferences (API chosen, the scope of the historical data in days 'range', the choosen graph theme, the choice to display graph grid or not, the time format and the date format).
  • The name of the APIs as well as their key are entered in the save.json file, these are browsed each time the application is started in order to fill in the API comboBoxes in the option tab and to pre-fill the field dedicated to API keys.

Features video

Currency.mp4

Screenshots

Currency Converter tab

conv_1

Conversion

conv_2

Graph visualisation

graph_1

Option tab

opt_1

Data copied to clipboard

copy_1

Graph image saved

save_img

Requirments

  • Python 3.8
  • numpy
  • PyQt5
  • pyqtgraph
  • pyperclip

currency_converter's People

Watchers

 avatar  avatar

currency_converter's Issues

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.