1+ """
2+ earthpy.api
3+ ================
4+
5+ A module to download data using various APIs.
6+
7+ """
8+
9+ import getpass
10+ import json
11+ import logging
12+ import os
13+ import pathlib
14+ import re
15+ import secrets
16+ import time
17+ from glob import glob
18+
19+ import keyring
20+ import requests
21+ import sqlite3
22+
23+ from ..project import Project
24+
25+ class APIDownloader (object ):
26+ """
27+ Parent class to download data from APIs
28+
29+ Parameters
30+ ----------
31+ download_label : str, optional
32+ Label used in data_dir and as the API job label
33+ project_dir : pathlike, optional
34+ Replacement directory for ~/earth-analytics/data/
35+ date_template: pd.DatetimeIndex
36+ Match date range with an existing DatetimeIndex
37+ start_date : date-like, optional
38+ Start date, parseable by pd.to_datetime(). Default
39+ is the most recent
40+ end_date : date-like, optional
41+ End date, parseable by pd.to_datetime()
42+ start_doy : str, optional
43+ Day of the year to start a recurring date range
44+ end_doy : str, optional
45+ Day of the year to end a recurring date range
46+ months : iterable of str or int, optional
47+ Iterable of month names or numbers.
48+ seasons : str, optional
49+ Names of seasons to download on an annually recurring basis.
50+ Seasons correspond to pandas DateTimeOffset conventions.
51+ start_year : str or int
52+ Start year for annually recurring dates, as YYYY or 'YYYY'
53+ end_year : str or int
54+ End year for annually recurring dates, as YYYY or 'YYYY'
55+ area_of_interest : gpd.GeoDataFrame, shapely geometry, or bounding box, optional
56+ The spatial boundary to subset. Bounding boxes should
57+ match GeoDataFrame.total_bounds style.
58+ auth_method :
59+
60+ Attributes
61+ ----------
62+ base_url : str
63+ The API endpoint url
64+ data_dir : pathlike
65+ Path to store data in. Default: ~/earth-analytics/data/{project_dir}
66+ download_label : str
67+ Label used in data_dir and as the API job label.
68+ """
69+
70+ base_url = NotImplemented
71+ download_key = NotImplemented
0 commit comments