-
Notifications
You must be signed in to change notification settings - Fork 12
About this project
What this amount really worth ? That's the simple question this project wants to answer.
News and political speeches contain a lot of big amounts. But such numbers are not easily understandable by themselves. Are you be able to represent yourself what really are 5 billion US Dollars?
We created this tool to compare such big amounts and this way we can easily know what worth an amount because we have examples we can refer to.
A story, in our application, represents a spending. It can be all kind of spending, like public budget, construction costs etc..
One spending can be describe by 3 major information:
- the
currency
used - the
year
of this spending - the
amount
of the spending
Every story must also have the following informations
- one
title
, - one
description
- and one
source
URL.
Such informations are really helpful to understand a particular spending event. Therefor we can answer the "What is it?" and "where does it come from?" questions.
We dissociated two kinds of stories.
- discrete
- repeatable stories
name | Description | Example |
---|---|---|
value | The value of the spending, it's the amount of the spending. | 11,000,000 |
currency | Story's currency | UK Pound (GBP) |
title | The story title | Consultancy on Cardiff Airport buyout |
description | A short description of our story | Consultancy work surrounding the purchase, including valuation, totalled more than £912,00 and with VAT that figure rose to £1.1m. |
country | The country (or zone) of the story | France (FRA) |
source | The story's source URL. | |
type | ||
status | ||
sticky | ||
year | ||
themes |
The autor of a story give us the following informations:
"value": 100e6,
"year": 2010,
"country": "FRA",
"currency": "EUR",
We need to complete its story in calculating and saving the following informations:
"inflation_last_year":?
"value_current": ?,
"value_usd_current":?,
###1. Fill the field inflation_last_year
The inflation is calculated using the Python module economics. inflation_last_year
is the last year for which we can compute the inflation. It depends of the data given by https://github.com/datasets/cpi
###2. Fill the field value_current
The field "value_current" is calculated using the inflation from the year of the story and the reference value "inflation_last_year".
How many "currency"(EUR) would I need in "inflation_last_year"(2012) to pay for what cost "value"(100e6) in "year"(2010)?
inflation.inflate(100e6, datetime.date(2012,1,1), datetime.date(2010,1,1), 'France')
# Response: `112871266.26 EUR`
###3. Fill the field value_usd_current
The USD is our reference currency for comparison, so we need to convert the "value_current" into an USD currency.
To do that we can request our Rates API like so:
http GET /api/rates/EUR HTTP/1.1
Content-Type: application/text; charset=utf-8
#Response: `1.3247`
So now we can convert the value into dollars:
coffeescript exchange_rate = response
user_amount_usd = exchange_rate * value_current
1.3247 * 112871266.26 = 149520744.509
# Response: `1.149520744.509 USD`
###3. Final Result
"value": 100e6,
"year": 2005,
"country": "FRA",
"currency": "EUR",
"value_current": 112871266.26,
"value_usd_current": 149520744.509,
"year": 2010,
"inflation_last_year": 2012,