Browse Source

[views][s]: added a graph of world total up to date.

master
anuveyatsu 4 years ago
parent
commit
84e775e888
2 changed files with 42 additions and 10 deletions
  1. +26
    -8
      datapackage.json
  2. +16
    -2
      process.py

+ 26
- 8
datapackage.json View File

@ -1,12 +1,12 @@
{ {
"bytes": 1467076,
"count_of_rows": 28980,
"hash": "6e25a726932e6dabaaa8b8e5ed578dd7",
"bytes": 1505482,
"count_of_rows": 29768,
"hash": "7603c441142db6032adf74caf6eb87f9",
"name": "covid-19", "name": "covid-19",
"profile": "data-package", "profile": "data-package",
"resources": [ "resources": [
{ {
"bytes": 1465368,
"bytes": 1503743,
"dialect": { "dialect": {
"caseSensitiveHeader": false, "caseSensitiveHeader": false,
"delimiter": ",", "delimiter": ",",
@ -18,7 +18,7 @@
}, },
"encoding": "utf-8", "encoding": "utf-8",
"format": "csv", "format": "csv",
"hash": "7b65c350a6e621e770bdce075df8b657",
"hash": "5cff1c69d0a1e017cefe86db5e89192d",
"name": "time-series-19-covid-combined", "name": "time-series-19-covid-combined",
"path": "data/time-series-19-covid-combined.csv", "path": "data/time-series-19-covid-combined.csv",
"profile": "tabular-data-resource", "profile": "tabular-data-resource",
@ -81,7 +81,7 @@
} }
}, },
{ {
"bytes": 1708,
"bytes": 1739,
"dialect": { "dialect": {
"delimiter": ",", "delimiter": ",",
"doubleQuote": true, "doubleQuote": true,
@ -91,7 +91,7 @@
}, },
"encoding": "utf-8", "encoding": "utf-8",
"format": "csv", "format": "csv",
"hash": "f261b5b527542ceace4f2c7941d69e40",
"hash": "1561dbd98fd8d7ac1286117c07e51076",
"name": "worldwide-aggregated", "name": "worldwide-aggregated",
"path": "data/worldwide-aggregated.csv", "path": "data/worldwide-aggregated.csv",
"profile": "data-resource", "profile": "data-resource",
@ -124,5 +124,23 @@
} }
} }
], ],
"title": "Novel Coronavirus 2019"
"title": "Novel Coronavirus 2019",
"views": [
{
"resources": [
"worldwide-aggregated"
],
"spec": {
"group": "Date",
"series": [
"Confirmed",
"Recovered",
"Deaths"
],
"type": "line"
},
"specType": "simple",
"title": "Total world to date"
}
]
} }

+ 16
- 2
process.py View File

@ -58,8 +58,6 @@ Flow(
), ),
delete_fields(['Case']), delete_fields(['Case']),
update_resource('time_series_19-covid-Deaths', name='time-series-19-covid-combined', path='data/time-series-19-covid-combined.csv'), update_resource('time_series_19-covid-Deaths', name='time-series-19-covid-combined', path='data/time-series-19-covid-combined.csv'),
update_package(name='covid-19', title='Novel Coronavirus 2019'),
dump_to_path(),
checkpoint('processed_data'), checkpoint('processed_data'),
# Duplicate the stream to create aggregated data # Duplicate the stream to create aggregated data
duplicate( duplicate(
@ -88,5 +86,21 @@ Flow(
} }
) )
), ),
update_package(
name='covid-19',
title='Novel Coronavirus 2019',
views=[
{
"title": "Total world to date",
"resources": ["worldwide-aggregated"],
"specType": "simple",
"spec": {
"group": "Date",
"series": ["Confirmed", "Recovered", "Deaths"],
"type": "line"
}
}
]
),
dump_to_path() dump_to_path()
).results()[0] ).results()[0]

Loading…
Cancel
Save