nasa / eo-metadata-tools

eo-metadata-tools is a set of repositories for working with Earth Observation metadata. At its core are common libraries and demonstration scripts for accessing the Common Metadata Repository, to be accompanied by more specific modules and scripts to do dataset-specific queries, metadata validation, etc...
Apache License 2.0
25 stars 11 forks source link

CMR-7435 - add a provider search #50

Closed jceaser closed 2 years ago

jceaser commented 2 years ago

CMR-7435 - CMR does not expose providers in a way that makes it easy for most users to find, add a basic Provider search functionality to the python library allowing curators to work with collections on a per-provider basis.

Add a new top level search object, like collections and granules, allowing for providers to be searched. Update backend code to handle more general requests.

On the back end, cmr_basic_url() is now a public function for building CMR URLs

Changes

Changes are organized into 4 commits:

Testing

from cmr.search import providers

# list all providers
result = providers.search()

# list some providers using RegExp
result = providers.search_by_id('.*ghrc.*')
codecov-commenter commented 2 years ago

Codecov Report

Merging #50 (2e27b30) into master (6126cde) will increase coverage by 0.03%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #50      +/-   ##
==========================================
+ Coverage   99.47%   99.50%   +0.03%     
==========================================
  Files           7        8       +1     
  Lines         755      803      +48     
==========================================
+ Hits          751      799      +48     
  Misses          4        4              
Impacted Files Coverage Δ
CMR/python/cmr/auth/token.py 100.00% <100.00%> (ø)
CMR/python/cmr/search/common.py 100.00% <100.00%> (ø)
CMR/python/cmr/search/providers.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6126cde...2e27b30. Read the comment docs.