@@ -4,156 +4,143 @@ Getting Started
4
4
Overview
5
5
--------------
6
6
7
- This package provides access to data from various Epidata API endpoints including COVIDcast,
8
- which provides numerous COVID-related data streams, updated daily.
7
+ This package provides access to data from various Epidata API endpoints including COVIDcast,
8
+ which provides numerous COVID-related data streams, updated daily.
9
9
10
10
.. _epidata-endpoints :
11
11
12
12
Epidata Data Sources
13
- --------------
13
+ --------------------
14
14
The parameters available for each source data are documented in each linked source-specific API page.
15
15
16
- |
17
16
**COVID-19 Data **
18
17
19
- .. list-table ::
18
+ .. list-table ::
20
19
:widths: 20 20 40
21
20
:header-rows: 1
22
21
23
22
* - Endpoint
24
23
- Name
25
24
- Description
26
- * - `covidcast <https://cmu-delphi.github.io/delphi-epidata/api/covidcast.html >`_
25
+ * - `pub_covidcast <https://cmu-delphi.github.io/delphi-epidata/api/covidcast.html >`_
27
26
- COVIDcast
28
27
- Delphi’s COVID-19 surveillance streams.
29
- * - `covidcast_meta <https://cmu-delphi.github.io/delphi-epidata/api/covidcast_meta.html >`_
28
+ * - `pub_covidcast_meta <https://cmu-delphi.github.io/delphi-epidata/api/covidcast_meta.html >`_
30
29
- COVIDcast metadata
31
30
- Metadata for Delphi's COVID-19 surveillance streams.
32
- * - `covid_hosp_facility <https://cmu-delphi.github.io/delphi-epidata/api/covid_hosp_facility.html >`_
31
+ * - `pub_covid_hosp_facility <https://cmu-delphi.github.io/delphi-epidata/api/covid_hosp_facility.html >`_
33
32
- COVID-19 Hospitalization by Facility
34
33
- COVID-19 Reported Patient Impact and Hospital Capacity - Facility Lookup
35
- * - `covid_hosp <https://cmu-delphi.github.io/delphi-epidata/api/covid_hosp.html >`_
34
+ * - `pub_covid_hosp <https://cmu-delphi.github.io/delphi-epidata/api/covid_hosp.html >`_
36
35
- COVID-19 Hospitalization
37
36
- COVID-19 Reported Patient Impact and Hospital Capacity.
38
37
39
- |
40
38
**Influenza Data **
41
39
42
- .. list-table ::
40
+ .. list-table ::
43
41
:widths: 20 20 40
44
42
:header-rows: 1
45
43
46
44
* - Endpoint
47
45
- Name
48
46
- Description
49
- * - `afhsb <https://cmu-delphi.github.io/delphi-epidata/api/afhsb.html >`_
50
- - AFHSB
51
- - ...
52
- * - `meta_afhsb <https://cmu-delphi.github.io/delphi-epidata/api/meta_afhsb.html >`_
53
- - AFHSB Metadata
54
- - ...
55
- * - `cdc <https://cmu-delphi.github.io/delphi-epidata/api/cdc.html >`_
56
- - CDC Page Hits
47
+ * - `pvt_cdc <https://cmu-delphi.github.io/delphi-epidata/api/cdc.html >`_
48
+ - CDC Page Hits
57
49
- ...
58
- * - `delphi <https://cmu-delphi.github.io/delphi-epidata/api/delphi.html >`_
59
- - Delphi’s Forecast
50
+ * - `pub_delphi <https://cmu-delphi.github.io/delphi-epidata/api/delphi.html >`_
51
+ - Delphi’s Forecast
60
52
- ...
61
- * - `ecdc_ili <https://cmu-delphi.github.io/delphi-epidata/api/ecdc_ili.html >`_
53
+ * - `pub_ecdc_ili <https://cmu-delphi.github.io/delphi-epidata/api/ecdc_ili.html >`_
62
54
- ECDC ILI
63
55
- ECDC ILI data from the ECDC website.
64
- * - `flusurv <https://cmu-delphi.github.io/delphi-epidata/api/flusurv.html >`_
65
- - FluSurv
56
+ * - `pub_flusurv <https://cmu-delphi.github.io/delphi-epidata/api/flusurv.html >`_
57
+ - FluSurv
66
58
- FluSurv-NET data (flu hospitaliation rates) from CDC.
67
- * - `fluview <https://cmu-delphi.github.io/delphi-epidata/api/fluview.html >`_
59
+ * - `pub_fluview <https://cmu-delphi.github.io/delphi-epidata/api/fluview.html >`_
68
60
- FluView
69
61
- Influenza-like illness (ILI) from U.S. Outpatient Influenza-like Illness Surveillance Network (ILINet).
70
- * - `fluview_meta <https://cmu-delphi.github.io/delphi-epidata/api/fluview_meta.html >`_
62
+ * - `pub_fluview_meta <https://cmu-delphi.github.io/delphi-epidata/api/fluview_meta.html >`_
71
63
- FluView Metadata
72
64
- Summary data about ``fluview ``.
73
- * - `fluview_clinical <https://cmu-delphi.github.io/delphi-epidata/api/fluview_clinical.html >`_
65
+ * - `pub_fluview_clinical <https://cmu-delphi.github.io/delphi-epidata/api/fluview_clinical.html >`_
74
66
- FluView Clinical
75
67
- ...
76
- * - `gft <https://cmu-delphi.github.io/delphi-epidata/api/gft.html >`_
68
+ * - `pub_gft <https://cmu-delphi.github.io/delphi-epidata/api/gft.html >`_
77
69
- Google Flu Trends
78
70
- Estimate of influenza activity based on volume of certain search queries. This is now a static endpoint due to discontinuation.
79
- * - `ght <https://cmu-delphi.github.io/delphi-epidata/api/ght.html >`_
80
- - Google Health Trends
81
- - Estimate of influenza activity based on volume of certain search queries.
82
- * - `kcdc_ili <https://cmu-delphi.github.io/delphi-epidata/api/kcdc_ili.html >`_
71
+ * - `pub_kcdc_ili <https://cmu-delphi.github.io/delphi-epidata/api/kcdc_ili.html >`_
83
72
- KCDC ILI
84
73
- KCDC ILI data from KCDC website.
85
- * - `meta <https://cmu-delphi.github.io/delphi-epidata/api/meta.html >`_
74
+ * - `pub_meta <https://cmu-delphi.github.io/delphi-epidata/api/meta.html >`_
86
75
- API Metadata
87
76
- Metadata for ``fluview ``, ``twitter ``, ``wiki ``, and ``delphi ``.
88
- * - `nidss_flu <https://cmu-delphi.github.io/delphi-epidata/api/nidss_flu.html >`_
77
+ * - `pub_nidss_flu <https://cmu-delphi.github.io/delphi-epidata/api/nidss_flu.html >`_
89
78
- NIDSS Flu
90
79
- Outpatient ILI from Taiwan's National Infectious Disease Statistics System (NIDSS).
91
- * - `nowcast <https://cmu-delphi.github.io/delphi-epidata/api/nowcast.html >`_
80
+ * - `pub_nowcast <https://cmu-delphi.github.io/delphi-epidata/api/nowcast.html >`_
92
81
- ILI Nearby
93
82
- A nowcast of U.S. national, regional, and state-level (weighted) percent ILI, available seven days (regionally) or five days (state-level) before the first ILINet report for the corresponding week.
94
- * - `quidel <https://cmu-delphi.github.io/delphi-epidata/api/quidel.html >`_
83
+ * - `pvt_quidel <https://cmu-delphi.github.io/delphi-epidata/api/quidel.html >`_
95
84
- Quidel
96
85
- Data provided by Quidel Corp., which contains flu lab test results.
97
- * - `sensors <https://cmu-delphi.github.io/delphi-epidata/api/sensors.html >`_
86
+ * - `pvt_sensors <https://cmu-delphi.github.io/delphi-epidata/api/sensors.html >`_
98
87
- Delphi's Digital Surveillance Sensors
99
88
- ...
100
- * - `twitter <https://cmu-delphi.github.io/delphi-epidata/api/twitter.html >`_
89
+ * - `pvt_twitter <https://cmu-delphi.github.io/delphi-epidata/api/twitter.html >`_
101
90
- Twitter Stream
102
91
- Estimate of influenza activity based on analysis of language used in tweets from HealthTweets.
103
- * - `wiki <https://cmu-delphi.github.io/delphi-epidata/api/wiki.html >`_
92
+ * - `pub_wiki <https://cmu-delphi.github.io/delphi-epidata/api/wiki.html >`_
104
93
- Wikipedia Access Logs
105
94
- Number of page visits for selected English, Influenza-related wikipedia articles.
106
- |
107
95
108
96
**Dengue Data **
109
97
110
- .. list-table ::
98
+ .. list-table ::
111
99
:widths: 20 20 40
112
100
:header-rows: 1
113
101
114
102
* - Endpoint
115
103
- Name
116
104
- Description
117
- * - `dengue_nowcast <https://cmu-delphi.github.io/delphi-epidata/api/dengue_nowcast.html >`_
105
+ * - `pub_dengue_nowcast <https://cmu-delphi.github.io/delphi-epidata/api/dengue_nowcast.html >`_
118
106
- Delphi's Dengue Nowcast
119
107
- ...
120
- * - `dengue_sensors <https://cmu-delphi.github.io/delphi-epidata/api/dengue_sensors.html >`_
108
+ * - `pvt_dengue_sensors <https://cmu-delphi.github.io/delphi-epidata/api/dengue_sensors.html >`_
121
109
- Delphi’s Dengue Digital Surveillance Sensors
122
110
- ...
123
- * - `nidss_dengue <https://cmu-delphi.github.io/delphi-epidata/api/nidss_dengue.html >`_
111
+ * - `pub_nidss_dengue <https://cmu-delphi.github.io/delphi-epidata/api/nidss_dengue.html >`_
124
112
- NIDSS Dengue
125
113
- Counts of confirmed dengue cases from Taiwan's NIDSS.
126
- * - `paho_dengue <https://cmu-delphi.github.io/delphi-epidata/api/paho_dengue.html >`_
114
+ * - `pub_paho_dengue <https://cmu-delphi.github.io/delphi-epidata/api/paho_dengue.html >`_
127
115
- PAHO Dengue
128
116
- ...
129
- |
130
117
131
118
**Norovirus Data **
132
119
133
- .. list-table ::
120
+ .. list-table ::
134
121
:widths: 20 20 40
135
122
:header-rows: 1
136
123
137
124
* - Endpoint
138
125
- Name
139
126
- Description
140
- * - `meta_norostat <https://cmu-delphi.github.io/delphi-epidata/api/meta_norostat.html >`_
127
+ * - `pvt_meta_norostat <https://cmu-delphi.github.io/delphi-epidata/api/meta_norostat.html >`_
141
128
- NoroSTAT Metadata
142
129
- ...
143
- * - `norostat <https://cmu-delphi.github.io/delphi-epidata/api/norostat.html >`_
130
+ * - `pvt_norostat <https://cmu-delphi.github.io/delphi-epidata/api/norostat.html >`_
144
131
- NoroSTAT
145
132
- Suspected and confirmed norovirus outbreaks reported by state health departments to the CDC.
146
133
147
- |
148
-
149
134
Epiweeks and Dates
150
135
------------------
151
- Epiweeks use the U.S. definition. That is, the first epiweek each year is the week, starting on a Sunday,
152
- containing January 4. See `this page <https://www.cmmcp.org/mosquito-surveillance-data/pages/epi-week-calendars-2008-2021 >`_ for more information.
136
+ Epiweeks use the U.S. definition. That is, the first epiweek each year is the
137
+ week, starting on a Sunday, containing January 4. See `this page
138
+ <https://www.cmmcp.org/mosquito-surveillance-data/pages/epi-week-calendars-2008-2021> `_
139
+ for more information.
153
140
154
141
Formatting for epiweeks is YYYYWW and for dates is YYYYMMDD.
155
142
156
- Use individual values, comma-separated lists or, a hyphenated range of values to specify single or several dates.
143
+ Use individual values, comma-separated lists or, a hyphenated range of values to specify single or several dates.
157
144
An ``EpiRange `` object can be also used to construct a range of epiweeks or dates. Examples include:
158
145
159
146
- ``param = 201530 `` (A single epiweek)
@@ -162,8 +149,6 @@ An ``EpiRange`` object can be also used to construct a range of epiweeks or date
162
149
- ``param = '201440,201501-201510' `` (Several epiweeks, including a range)
163
150
- ``param = EpiRange(20070101, 20071231) `` (A range of dates)
164
151
165
- |
166
-
167
152
.. _getting-started :
168
153
169
154
Basic examples
@@ -176,8 +161,8 @@ distributed through Facebook, for every county in the United States between
176
161
2020-05-01 and 2020-05-07:
177
162
178
163
>>> from epidatpy.request import Epidata, EpiRange
179
- >>> apicall = Epidata.covidcast(" fb-survey" , " smoothed_cli" ,
180
- ... " day" , " county" ,
164
+ >>> apicall = Epidata.covidcast(" fb-survey" , " smoothed_cli" ,
165
+ ... " day" , " county" ,
181
166
... EpiRange(20200501 , 20200507 ), " *" )
182
167
>>> data = apicall.df()
183
168
>>> data.head()
@@ -197,7 +182,7 @@ May 1st were updated on September 3rd based on new data, giving a ``lag`` of 125
197
182
See the :py:func: `epidatpy.request.Epidata.covidcast ` documentation for further details on the returned
198
183
columns.
199
184
200
- In the above code, the ``.df() `` function on the ``apicall `` variable generated a Pandas DataFrame. We can use
185
+ In the above code, the ``.df() `` function on the ``apicall `` variable generated a Pandas DataFrame. We can use
201
186
other :ref: `output functions <output-data >` to parse the requested API call in different formats. To parse the data
202
187
into JSON format, we can use the following command:
203
188
@@ -238,7 +223,7 @@ into JSON format, we can use the following command:
238
223
.
239
224
}]
240
225
241
- Note that all of the :ref: `output functions <output-data >` have a ``field `` parameter which takes in any form of iterator objects
226
+ Note that all of the :ref: `output functions <output-data >` have a ``field `` parameter which takes in any form of iterator objects
242
227
to enable fetching the data with customization (e.g. specifying which fields or columns to output). Similar to the previous example,
243
228
to parse the data in JSON format, but customize the field to show only ``geo_value `` and ``value ``, we would use the following
244
229
command:
@@ -259,18 +244,13 @@ command:
259
244
.
260
245
}]
261
246
262
-
263
- |
264
-
265
247
**Wikipedia Access article "influenza" on 2020w01 **
266
248
267
249
>>> apicall_wiki = Epidata.wiki(articles = ' influenza' , epiweeks = ' 202001' )
268
250
>>> data = apicall_wiki.json()
269
251
>>> print (data)
270
252
[{'article': 'influenza', 'count': 6516, 'total': 663604044, 'hour': -1, 'epiweek': datetime.date(2019, 12, 29), 'value': 9.81910834}]
271
253
272
- |
273
-
274
254
**FluView on 2019w01 (national) **
275
255
276
256
>>> apicall_fluview = Epidata.fluview(regions = ' nat' , epiweeks = ' 201901' )
@@ -294,10 +274,3 @@ command:
294
274
'ili': 3.63095}],
295
275
'result': 1,
296
276
'message': 'success'}
297
-
298
- |
299
-
300
- Other examples (TODO)
301
- --------------
302
-
303
- (TODO)
0 commit comments