GithubHelp home page GithubHelp logo

pppconverter's Introduction

Calculate how much money is worth in a different country. Uses data from World Bank.

Note: Works on python3.4 and above.

Installation Instructions

  1. Clone the source code

     git clone https://github.com/nigelbabu/pppconverter.git
    
  2. Create a virtual environments and install the dependencies

     python -m venv env
     source env/bin/activate
     pip install -r requirements.txt
    
  3. Create the sqlite database by running the website.py file.

     flask --app=manage user db_init
    
  4. Import the CSV into the sqlite database.

     		flask --app=manage user importcountries -f countries.csv
     		flask --app=manage user importcsv -f data.csv
    
  5. Run the site.

     flask --app=website --debug run
    

Updating the data

  1. Download the CSV data from the world bank portal and unzip the file.

  2. Run the parsecsv.py script to create a file called parsed_data.csv.

     flask --app=manage user parsecsv -f /path/to/file
    
  3. Replace data.csv file with the newly created parsed_data.csv file.

  4. Import the new CSV into the sqlite database.

     		flask --app=manage user importcsv -f data.csv
    
  5. PROFITT!!

pppconverter's People

Contributors

nigelbabu 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pppconverter's Issues

The calculation seems to be wrong

Hi @nigelbabu

I wanted to check what formula are you using to calculate the To_country salary based on the PPP data by world bank and I got this formula from your code

var equivalent_salary = (Number(salary) / from_country_data.ppp) * to_country_data.ppp;

https://github.com/nigelbabu/pppconverter/blob/554f2332c561aab35647a78b7b9cdd67219fe977/static/js/app.js

Based on which if I do the same calculation in excel as shown below

image

image

whereas the result by your tool using the same formula show

image

_Can you please check and tell me if I am doing something wrong ? _

Show a table

Show a table instead of just one country, so all countries can be checked. Most often people are curious rather than looking for specific information.

How to setup up the db?

No guideline on how to set up the DB.
Running the server using manage.py doesn't create the DB with the schema.

NaN.N amounts

Using your currency converter at http://salaryconverter.nigelb.me, I tried to convert $100,000 into UKP. The result was:

In United Kingdom, NaN.N GBP will allow you to buy the same things you'd buy with NaN.N USD in United States.

Argentina country is missing and environment setup doesn't work

Missing Argentina is probably related to requiring newer data import. I followed the instructions to set up a local environment and update the CSV data in order to check Argentina. The process seems to have been successful from the commands' output, but it doesn't work. Whenever I go to http://127.0.0.1:5000/ I get an error logged to the terminal:

env ❯ ./manage.py runserver
 * Serving Flask app "website" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
/Users/alejandro/Development/pppconverter/website.py:49: FlaskWTFDeprecationWarning: "flask_wtf.Form" has been renamed to "FlaskForm" and will be removed in 1.0.
  form = SalaryForm()
/Users/alejandro/Development/pppconverter/env/lib/python3.7/site-packages/sqlalchemy/sql/sqltypes.py:639: SAWarning: Dialect sqlite+pysqlite does *not* support Decimal objects natively, and SQLAlchemy must convert from floating point - rounding errors and other issues may occur. Please consider storing Decimal numbers as strings or integers on this platform for lossless storage.
  "storage." % (dialect.name, dialect.driver)
[2019-01-28 18:36:54,358] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
  File "/Users/alejandro/Development/pppconverter/env/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/alejandro/Development/pppconverter/env/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/alejandro/Development/pppconverter/env/lib/python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/alejandro/Development/pppconverter/env/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/Users/alejandro/Development/pppconverter/env/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/alejandro/Development/pppconverter/env/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/alejandro/Development/pppconverter/website.py", line 69, in index
    'conversion_rate': float(conversion.value) * 100,
AttributeError: 'NoneType' object has no attribute 'value'
127.0.0.1 - - [28/Jan/2019 18:36:54] "GET / HTTP/1.1" 500 -

Updating data doesn't work

The instructions for updating the data no longer works — the ZIP file downloaded from World Bank portal contains three .csv files, all of which create a zero-sized parsed_data.csv.

New PPP Calculator based on latest OCED data

Greetings.

I appreciate this converter, But since this converter is not maintained anymore and that several countries were not included I have built my own PPP Calculator based on latest OCED data.

You're all welcomed to use and contribute towards improving it.

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.