Skip to content

Commit 692e3a6

Browse files
authored
Merge pull request #906 from earthlab/apppears
Apppears
2 parents 5b7bfb3 + 3b885d6 commit 692e3a6

24 files changed

+2064
-267
lines changed

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"python.testing.unittestEnabled": false,
3+
"python.testing.pytestEnabled": true,
4+
"python.testing.pytestArgs": [
5+
"earthpy/tests"
6+
]
7+
}

CONTRIBUTORS.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Maintainers
66

77
EarthPy is maintained by a core group of Python enthusiasts at Earth Lab - University of Colorado, Boulder
88

9-
* Nathan Korinek (@nkorinek)
109
* Elsa Culler (@eculler)
1110

1211
Contributors
@@ -20,5 +19,5 @@ package.
2019
* Joseph McGlinchy (@joemcglinchy)
2120
* Jenny Palomino (@jlpalomino)
2221
* Max Joseph (@mbjoseph)
23-
* Joseph McGlinchy (@joemcglinchy)
24-
* Jenny Palomino (@jlpalomino)
22+
* Nathan Korinek (@nkorinek)
23+
* Elsa Culler (@eculler)

ci/py310-env.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ dependencies:
77
# Core scientific python
88
- matplotlib
99
- scipy
10+
# System management
11+
- keyring
12+
- platformdirs
1013

1114
# Geo stuff
1215
- geopandas

ci/py311.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: earthpy-dev
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
6+
- python=3.11
7+
# Core scientific python
8+
- matplotlib
9+
- scipy
10+
# System management
11+
- keyring
12+
- platformdirs
13+
14+
# Geo stuff
15+
- geopandas
16+
- rasterio
17+
- folium
18+
- pytest-vcr
19+
- pytest-cov
20+
- pytest
21+
- setuptools
22+
- descartes
23+
- seaborn
24+
- pillow
25+
- scikit-image
26+
- requests

ci/py312.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: earthpy-dev
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
6+
- python=3.12
7+
# Core scientific python
8+
- matplotlib
9+
- scipy
10+
# System management
11+
- keyring
12+
- platformdirs
13+
14+
# Geo stuff
15+
- geopandas
16+
- rasterio
17+
- folium
18+
- pytest-vcr
19+
- pytest-cov
20+
- pytest
21+
- setuptools
22+
- descartes
23+
- seaborn
24+
- pillow
25+
- scikit-image
26+
- requests

ci/py38-env.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ dependencies:
77
# Core scientific python
88
- matplotlib
99
- scipy
10+
# System management
11+
- keyring
12+
- platformdirs
1013

1114
# Geo stuff
1215
- geopandas

ci/py39-env.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ dependencies:
77
# Core scientific python
88
- matplotlib
99
- scipy
10+
# System management
11+
- keyring
12+
- platformdirs
1013

1114
# Geo stuff
1215
- geopandas

earthpy/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import importlib.resources
88
import json
99
from .io import Data
10+
from .project import Project
1011

1112
data = Data()
1213
"""

earthpy/api/__init__.py

Whitespace-only changes.

earthpy/api/api.py

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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

Comments
 (0)