Skip to content

Commit

Permalink
Suggested changes from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Reinhart <areinhar@stat.cmu.edu>
  • Loading branch information
krivard and capnrefsmmat committed May 15, 2023
1 parent 178b283 commit c320433
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Python-packages/covidcast-py/covidcast/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"""

from .covidcast import signal, metadata, aggregate_signals
from .covidcast import signal, metadata, aggregate_signals, use_api_key
from .plotting import plot, plot_choropleth, get_geo_df, animate
from .geography import (fips_to_name, cbsa_to_name, abbr_to_name,
name_to_abbr, name_to_cbsa, name_to_fips,
Expand Down
17 changes: 10 additions & 7 deletions Python-packages/covidcast-py/docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,17 @@ May 1st were updated on May 23rd based on new data, giving a ``lag`` of 22 days.
See the :py:func:`covidcast.signal` documentation for details on the returned
data frame.

By default, this package submits queries to the API anonymously. If you have an
API key, you can use it with this package by calling
:py:func:`covidcast.use_api_key`, then call fetch functions as normal:
.. _api-key-usage:
.. note ::
>>> covidcast.use_api_key("your_api_key")
>>> data = covidcast.signal("fb-survey", "smoothed_cli",
... date(2020, 5, 1), date(2020, 5, 7),
... "county")
By default, this package submits queries to the API anonymously. If you have an
API key, you can use it with this package by calling
:py:func:`covidcast.use_api_key`, then call fetch functions as normal:
>>> covidcast.use_api_key("your_api_key")
>>> data = covidcast.signal("fb-survey", "smoothed_cli",
... date(2020, 5, 1), date(2020, 5, 7),
... "county")
The API documentation lists each available signal and provides technical details
on how it is estimated and how its standard error is calculated. In this case,
Expand Down
14 changes: 8 additions & 6 deletions Python-packages/covidcast-py/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ To get started, check out :ref:`getting started <getting-started>`.
free API key <https://forms.gle/hkBr5SfQgxguAfEt7>`_ even if your usage falls
within the anonymous usage limits. API key usage helps us understand who and
how others are using our Delphi Epidata API, which may in turn inform our
future research, data partnerships, and funding. As we are a research group,
our server resources are limited and cannot support high-volume interactive
use (with or without an API key). If you use data from the COVIDcast Epidata
API to power a public product, dashboard, app, or other service, please
download the data you need and store it centrally rather than making API
requests for every user.
future research, data partnerships, and funding. For usage instructions, see
:py:func:`covidcast.use_api_key`.
As we are a research group, our server resources are limited and cannot
support high-volume interactive use (with or without an API key). If you use
data from the COVIDcast Epidata API to power a public product, dashboard,
app, or other service, please download the data you need and store it
centrally rather than making API requests for every user.
See also the `COVIDcast Terms of Use
<https://covidcast.cmu.edu/terms-of-use.html>`_, noting that the data is a
Expand Down
5 changes: 5 additions & 0 deletions Python-packages/covidcast-py/docs/signals.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Fetching Data
=============

API Keys
--------

.. autofunction:: covidcast.use_api_key

Signals
-------

Expand Down

0 comments on commit c320433

Please sign in to comment.