Browse Source

[metadata][xs]: add 'name' and 'title' properties to datapackage.json.

master
anuveyatsu 4 years ago
parent
commit
6024877690
2 changed files with 6 additions and 3 deletions
  1. +4
    -2
      datapackage.json
  2. +2
    -1
      process.py

+ 4
- 2
datapackage.json View File

@ -1,7 +1,8 @@
{ {
"bytes": 1465368, "bytes": 1465368,
"count_of_rows": 28920, "count_of_rows": 28920,
"hash": "0645dcfca5d10e757252920dbcdbe67d",
"hash": "ac80ca047703880c26c97d8a6dc73df8",
"name": "covid-19",
"profile": "data-package", "profile": "data-package",
"resources": [ "resources": [
{ {
@ -79,5 +80,6 @@
] ]
} }
} }
]
],
"title": "Novel Coronavirus 2019"
} }

+ 2
- 1
process.py View File

@ -1,4 +1,4 @@
from dataflows import Flow, load, unpivot, find_replace, set_type, dump_to_path, update_resource, join, add_computed_field, delete_fields
from dataflows import Flow, load, unpivot, find_replace, set_type, dump_to_path, update_package, update_resource, join, add_computed_field, delete_fields
BASE_URL = 'https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/' BASE_URL = 'https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/'
CONFIRMED = 'time_series_19-covid-Confirmed.csv' CONFIRMED = 'time_series_19-covid-Confirmed.csv'
@ -57,5 +57,6 @@ Flow(
), ),
delete_fields(['Case']), delete_fields(['Case']),
update_resource('time_series_19-covid-Deaths', name='time-series-19-covid-combined', path='time-series-19-covid-combined.csv'), update_resource('time_series_19-covid-Deaths', name='time-series-19-covid-combined', path='time-series-19-covid-combined.csv'),
update_package(name='covid-19', title='Novel Coronavirus 2019'),
dump_to_path() dump_to_path()
).results()[0] ).results()[0]

Loading…
Cancel
Save