Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable sort_key for sorting results #430

Open
abarciauskas-bgse opened this issue Jan 19, 2024 · 0 comments
Open

Enable sort_key for sorting results #430

abarciauskas-bgse opened this issue Jan 19, 2024 · 0 comments
Labels
type: enhancement New feature or request

Comments

@abarciauskas-bgse
Copy link
Contributor

👋🏽 both collections and granules allow for sorting results by a sort key (see https://cmr.earthdata.nasa.gov/search/site/docs/search/api.html#sorting-collection-results). It would be great to add this parameter to search_data for sorting granule results by something like start_date or end_date.

Example:

first_result = earthaccess.search_data(
    short_name=short_name,
    cloud_hosted=True,
    count=1,
    sort_key='+end_date'
)

last_result = earthaccess.search_data(
    short_name=short_name,
    cloud_hosted=True,
    count=1,
    sort_key='-end_date'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants