Skip to content

Commit 2beb894

Browse files
committed
Update docs: add metadata statistics
1 parent 7dc1e4e commit 2beb894

File tree

2 files changed

+79
-2
lines changed

2 files changed

+79
-2
lines changed

delphi_epidata/_endpoints.py

+63-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,69 @@ def covid_hosp_state_timeseries(
347347
)
348348

349349
def covidcast_meta(self) -> CALL_TYPE:
350-
"""Fetch Delphi's COVID-19 Surveillance Streams metadata"""
350+
"""Fetch COVIDcast surveillance stream metadata.
351+
352+
Obtains a data frame of metadata describing all publicly available data
353+
streams from the COVIDcast API. See the `data source and signals
354+
documentation
355+
<https://cmu-delphi.github.io/delphi-epidata/api/covidcast_signals.html>`_
356+
for descriptions of the available sources.
357+
358+
:returns: A `EpiDataCall` object containing the following information:
359+
360+
``data_source``
361+
Data source name.
362+
363+
``signal``
364+
Signal name.
365+
366+
``time_type``
367+
Temporal resolution at which this signal is reported. "day", for
368+
example, means the signal is reported daily.
369+
370+
``geo_type``
371+
Geographic level for which this signal is available, such as county,
372+
state, msa, hss, hrr, or nation. Most signals are available at multiple geographic
373+
levels and will hence be listed in multiple rows with their own
374+
metadata.
375+
376+
``min_time``
377+
First day for which this signal is available. For weekly signals, will be
378+
the first day of the epiweek.
379+
380+
``max_time``
381+
Most recent day for which this signal is available. For weekly signals, will be
382+
the first day of the epiweek.
383+
384+
``num_locations``
385+
Number of distinct geographic locations available for this signal. For
386+
example, if `geo_type` is county, the number of counties for which this
387+
signal has ever been reported.
388+
389+
``min_value``
390+
The smallest value that has ever been reported.
391+
392+
``max_value``
393+
The largest value that has ever been reported.
394+
395+
``mean_value``
396+
The arithmetic mean of all reported values.
397+
398+
``stdev_value``
399+
The sample standard deviation of all reported values.
400+
401+
``last_update``
402+
The UTC datetime for when the signal value was last updated.
403+
404+
``max_issue``
405+
Most recent date data was issued.
406+
407+
``min_lag``
408+
Smallest lag from observation to issue, in days.
409+
410+
``max_lag``
411+
Largest lag from observation to issue, in days.
412+
"""
351413
return self._create_call(
352414
"covidcast_meta/",
353415
{},

docs/signals_covid.rst

+16-1
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,25 @@ Fetching Data
44
Signals
55
-------
66

7+
This package provides a key function to obtain any signal of interest as a
8+
Pandas data frame. Detailed examples are provided in the :ref:`usage examples
9+
<getting-started>`.
710

811

912

13+
Sometimes you would like to work with multiple signals -- for example, to obtain
14+
several signals at every location, as part of building models of features at
15+
each location. For convenience, the package provides a function to produce a
16+
single data frame containing multiple signals at each location.
17+
18+
1019

1120

1221
Metadata
1322
--------
1423

1524
Many data sources and signals are available, so one can also obtain a data frame
16-
of all signals and their associated metadata
25+
of all signals and their associated metadata:
1726

1827
>>> from delphi_epidata.request import CovidcastEpidata
1928
>>> covid_ds = CovidcastEpidata()
@@ -28,3 +37,9 @@ More details of the two data frames are listed below.
2837
.. autoclass:: delphi_epidata.request.CovidcastDataSources()
2938
:members:
3039

40+
More metadata statistics can also be obtained as follows:
41+
42+
>>> from delphi_epidata.request import Epidata
43+
>>> df = Epidata.covidcast_meta().df()
44+
45+
.. autofunction:: delphi_epidata.request.Epidata.covidcast_meta()

0 commit comments

Comments
 (0)