matthiasgomolka / simfinapi

Makes 'SimFin' data (https://simfin.com/) easily accessible in R.
19 stars 4 forks source link

Leightweight `sfa` class #58

Open matthiasgomolka opened 6 months ago

matthiasgomolka commented 6 months ago

Every sfa_* function requires two inputs: api_key = getOption("sfa_api_key") and cache_dir = getOption("sfa_cache_dir"). If we would implement a simple class which stores these two arguments, all existing functions could be implemented as methods of this class. All these methods would be simplified because the arguments above would be already set.

The syntax would look something like this:

sfa <- SimFinAPI(api_key = ..., cache_dir = ...) # instantiate the class

sfa$load_companies()

If we ever get to offer bulk downloads as well, this might also be beneficial since the class object could be used to keep track of already downloaded files.