Skip to content

Feature: CMR Concept ID <-> Human Readible Name translation tool #24

@lsterzinger

Description

@lsterzinger

Hi python-cmr folks,

I'm a developer at GES DISC, and during a hackweek last week my colleague @eni-awowale created a CLI tool (tentatively named CNR: CMR Name Resolver) that translates concept_id's to native_ids (and vise-versa). It's not publically shareable at this point but if you have access to Earthdata bitbucket you can see our repo here: https://git.earthdata.nasa.gov/projects/GDDS/repos/cnr/browse

After discussion with our manager @briannapagan we were wondering if this would be something you'd be interested in merging into python-cmr. Before opening any PRs I wanted to start a discussion on this to make sure 1) this is something you all are interested in having in this project and 2) we're on the same page for how to implement.

The tool is a python script that gets installed as a CLI tool in the ./bin directory of your python install by using [project.scripts] in pyproject.toml. Example usage:

$ cnr M2T1NXSLV_5.12.4 
prod    C1276812863-GES_DISC
uat    C1245662776-EEDTEST
uat    C1215802944-GES_DISC

$ cnr -e prod M2T1NXSLV_5.12.4 
prod    C1276812863-GES_DISC

$ cnr C1215664070-GES_DISC           
uat	GLDAS_NOAH10_3H_2.0

$ cnr -p MERRA2_100.inst1_2d_asm_Nx.19800101.nc4 -p GES_DISC
prod	G1276974976-GES_DISC
uat	G1256129374-GES_DISC
sit	None

The full list of aceeptable arguments:

$ cnr -h
usage: cnr [-h] [-e {prod,sit,uat}] [-p PROVIDER] [-c] [-g] [-s] id

Get a concept-id or native-id given either

positional arguments:
  id                    Collection ID or Native ID to convert

options:
  -h, --help            show this help message and exit
  -e {prod,sit,uat}, --environment {prod,sit,uat}
                        Environment to use
  -p PROVIDER, --provider PROVIDER
                        Used for a granule and collection query in CMR with a provider
                        id
  -c, --collection      Used to denote a collection query in CMR
  -g, --granule         Used to denote a granule query in CMR
  -s, --service         Used to denote a service query in CMR

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions