Skip to content

Instantly share code, notes, and snippets.

@mnowotka
Created April 23, 2014 13:00
Show Gist options
  • Save mnowotka/11214356 to your computer and use it in GitHub Desktop.
Save mnowotka/11214356 to your computer and use it in GitHub Desktop.
# let's import settings class first:
from chembl_webresource_client.settings import Settings
# we can now decide which protocol to use:
Settings.Instance().WEBSERVICE_PROTOCOL = 'http'
# point our client to our local webservices instance
Settings.Instance().WEBSERVICE_DOMAIN = 'localhost'
# and change their prefix:
Settings.Instance().WEBSERVICE_PREFIX = '/ws'
# so now root url will look like this:
# 'http://localhost/ws', instead of default:
# 'https://www.ebi.ac.uk/chemblws'
# default request timeout can be easily changed as well:
Settings.Instance().TIMEOUT = 10
# we can also decide to swhich off cache:
Settings.Instance().CACHING = False
# or switch off fast saving in which case we make sure data sored in cache won't be corrupted:
Settings.Instance().FAST_SAVE = False
# when retrieving data asynchronously we can decied how many requests will be made at once:
Settings.Instance().FAST_SAVE = CONCURRENT_SIZE = 15
# or how large should the bulk retrieval be to use async requests:
Settings.Instance().ASYNC_TRESHOLD = 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment