pooch icon indicating copy to clipboard operation
pooch copied to clipboard

Support URL mirrors in the Pooch class

Open dstansby opened this issue 3 years ago • 2 comments

Description of the desired feature: It would be great to support data mirrors, ie. having values for base_url where the second, third etc. values can be used if the first URL isn't available.

Are you willing to help implement and maintain this feature?

Possibly

dstansby avatar Jun 23 '22 09:06 dstansby

Hi @dstansby thanks for suggesting this! I can see why this would be a nice feature to have.

One way to implement this would be allow base_url to take a list/tuple/set and then put this part of pooch.Pooch.fetch in a for loop with try: ... except:... blocks: https://github.com/fatiando/pooch/blob/da2d93c77ba8c7a17fa5174905f3f74bcb931cc4/pooch/core.py#L587

I don't have a lot of time to implement this right now but would gladly review (or ask someone else to review) if you're willing to give this a try.

leouieda avatar Jun 27 '22 09:06 leouieda

This would also be restricted to the Pooch class, at least for now. We can think about adding it to retrieve later is there is a desire.

leouieda avatar Jun 27 '22 09:06 leouieda