stactools icon indicating copy to clipboard operation
stactools copied to clipboard

Add entry point group for loading `read_href_modifier` from the command line

Open TomAugspurger opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

To facilitate creating STAC items from URLs that require a read_href_modifier, I'd like to use something like

stac modis create-item https://modiseuwest.blob.core.windows.net/modis-061/MYD11A1/00/08/2002200/MYD11A1.A2002200.h00v08.061.2020128174536.hdf.xm --read-href-modifier=stactools.planetary_computer:sign

Describe the solution you'd like

I think we can do this with Entry Points. stactools would add a group, and various packages (like planetary-computer) could register entrypoints. The change required in stactools packages would be for the CLI to load the user-provided argument as an entrypoint using importlib.metatdata.

Describe alternatives you've considered

Additional context Add any other context or screenshots about the feature request here.

TomAugspurger avatar Dec 06 '22 13:12 TomAugspurger

I'm unsure how this would propagate down to the dataset packages (e.g. stactools-modis). Dataset subpackages aren't required (and don't always) use any stactools functionality -- they often roll their own create_item functions.

gadomski avatar Dec 06 '22 13:12 gadomski