Skip to content

Commit

Permalink
API key notes in module docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
zmoon committed Sep 19, 2024
1 parent b0a77e6 commit 7d16a44
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions monetio/obs/openaq.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Get v1 (government-only) OpenAQ data from AWS.
https://openaq.org/
https://openaq-fetches.s3.amazonaws.com/index.html
"""

Expand Down
13 changes: 11 additions & 2 deletions monetio/obs/openaq_v2.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
"""Get AQ data from the OpenAQ v2 REST API.
Visit https://docs.openaq.org/docs/getting-started to get an API key
and set environment variable ``OPENAQ_API_KEY`` to use it.
For example, in Bash:
.. code-block:: bash
export OPENAQ_API_KEY="your_api_key_here"
https://openaq.org/
https://api.openaq.org/docs#/v2
Expand Down Expand Up @@ -60,8 +69,8 @@ def _api_key_warning(func):
def wrapper(*args, **kwargs):
if API_KEY is None:
warnings.warn(
"Non-cached requests to the OpenAQ v2 web API will be slow without an API key, "
"or might fail (HTTP error 401). "
"Non-cached requests to the OpenAQ v2 web API will be slow without an API key "
"or requests will fail (HTTP error 401). "
"Obtain one (https://docs.openaq.org/docs/getting-started#api-key) "
"and set your OPENAQ_API_KEY environment variable.",
stacklevel=2,
Expand Down

0 comments on commit 7d16a44

Please sign in to comment.