ropensci / taxadb

:package: Taxonomic Database
https://docs.ropensci.org/taxadb
Other
43 stars 13 forks source link

question: how to programmatically get a list of supported databases? #103

Open atn38 opened 2 years ago

atn38 commented 2 years ago

Hullo,

My apologies if it's obvious, I didn't find a solution from quickly scanning the docs. My use case: programmatically check a list of providers against what taxadb supports so the downstream code can proceed appropriately.

cboettig commented 2 years ago

Sorry, it's a good question; databases are a moving target and so the static docs haven't really kept up.

Currently the best thing is to consult the internal 'provenance' table, e.g. via:

prov <- taxadb:::parse_prov()
prov

That gives a data.frame of all the database tables taxadb knows about, by version. It's perhaps not super clean but should at least be good for programmatic use.

atn38 commented 2 years ago

Thanks @cboettig. Looks like the quick and easy way to proceed for my case is to hardcode in the list.

cboettig commented 2 years ago

I still suggest you use the prov table, as you can see it is a moving target and you are better off being precise about which year of the database you are interested in, and if you intend to fall back on to earlier years if/when a given provider is not available. but of course it is up to you.

atn38 commented 2 years ago

Ok, I'll look into it. to be quite honest, my operations are not sophisticated enough to discern between different years of a given database, so that aspect wasn't even on my radar.

On Thu, Mar 24, 2022 at 2:09 PM Carl Boettiger @.***> wrote:

I still suggest you use the prov table, as you can see it is a moving target and you are better off being precise about which year of the database you are interested in, and if you intend to fall back on to earlier years if/when a given provider is not available. but of course it is up to you.

— Reply to this email directly, view it on GitHub https://github.com/ropensci/taxadb/issues/103#issuecomment-1077959229, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKAZD5XJFYQZBNDILW3NFGTVBS4VRANCNFSM5RR32VIQ . You are receiving this because you authored the thread.Message ID: @.***>