bioservices icon indicating copy to clipboard operation
bioservices copied to clipboard

Changing configuration location

Open carleshf opened this issue 4 years ago • 1 comments

Dear all,

I am willing to change the configuration location for bioservices but I do not see how to do it since the class BioServicesConfig allows to change the default but not the path.

¿Recommendations?

Thanks

carleshf avatar Sep 28 '20 12:09 carleshf

Short answer: this is not possible unfortunately.

Long answer: The configuration framework used in bioservices, comes from easydev package where I used the appdirs package itself. This package takes care of dealing with config files directory on different OS platform. In the BioServicesConfig class, it uses easydev.appdirs and the configuration location is a read-only property stored in the attribute settings.appdirs.user_config_dir where settings is the attribute of all bioservices services classes. For instance:

from bioservices import UniProt
u = UniProt()
u.settings.appdirs.user_config_dir

Note that I am changing the API little by little and future version with have the following API:

from bioservices import UniProt u = UniProt() u.services.settings.appdirs.user_config_dir

Now, saying that this attribute (user_config_dir) is read-only so you cannot change it. That would required to change easydev package and the module appdirs. Another solution is to create a class that inherits from Appdirs and use it in bioservices.settings. The user_config_path could then be changed as write/read property

cokelaer avatar Nov 23 '20 08:11 cokelaer