Calculate how much money is worth in a different country. Uses data from World Bank.
Note: Works on python3.4 and above.
-
Clone the source code
git clone https://github.com/nigelbabu/pppconverter.git
-
Install Golang for your computer
-
Build the server and the CLI tools
go mod download go build go build -o pppcli cli/main.go
-
Create a config.yaml with the following parameters at minimum
database: temp.db static: ./static templates: ./templates/*.html
-
Create the sqlite database by running pppcli.
./pppcli dbInit
-
Import the CSV into the sqlite database.
./pppcli import -f data.csv ./pppcli importCountries -f countries.csv
-
Insert a key into the SQLite DB by hand to indicate USD to GBP rate for 100 USD.
sqlite3 temp.db "INSERT OR IGNORE INTO configs (key, value) VALUES ('gbp_rate', 77.75); UPDATE configs SET key='gbp_rate', value=77.75 WHERE key='gbp_rate';"
-
Run the site.
./pppconverter
- The data.csv file in the repo will not be frequently updated, however, the site itself will fetch new data once a week.
- Some automation code is yet to be open sourced as I'm still working out some minor bugs in the code.