original_docstring: Download the given version of DrugBank.
  
      :param username:
          The DrugBank username. If not passed, looks up in the environment
          ``DRUGBANK_USERNAME``. If not found, raises a ValueError.
      :param password:
          The DrugBank password. If not passed, looks up in the environment
          ``DRUGBANK_PASSWORD``. If not found, raises a ValueError.
      :param version:
          The DrugBank version. If not passed, uses :mod:`bioversions` to
          look up the most recent version.
      :param prefix:
          The prefix and subkeys passed to :func:`pystow.ensure` to specify
          a non-default location to download the data to.
      
docstring: Download the given version of DrugBank.
docstring_tokens: Download the given version of DrugBank .
code: def download_drugbank(
      username: Optional[str] = None,
      password: Optional[str] = None,
      version: Optional[str] = None,
      prefix: Union[None, str, Sequence[str]] = None,
  ) -> Path:
      """Download the given version of DrugBank.
  
      :param username:
          The DrugBank username. If not passed, looks up in the environment
          ``DRUGBANK_USERNAME``. If not found, raises a ValueError.
      :param password:
          The DrugBank password. If not passed, looks up in the environment
          ``DRUGBANK_PASSWORD``. If not found, raises a ValueError.
      :param version:
          The DrugBank version. If not passed, uses :mod:`bioversions` to
          look up the most recent version.
      :param prefix:
          The prefix and subkeys passed to :func:`pystow.ensure` to specify
          a non-default location to download the data to.
      """
      if version is None:
          try:
              import bioversions
          except ImportError:
              raise ImportError('must first `pip install bioversions` to get latest DrugBank version automatically')
          else:
              version = bioversions.get_version('drugbank')
  
      url = f'https://go.drugbank.com/releases/{version.replace(".", "-")}/downloads/all-full-database'
  
      if prefix is None:
          prefix = ['drugbank']
      elif isinstance(prefix, str):
          prefix = [prefix]
  
      username = get_config('drugbank', 'username', passthrough=username)
      if username is None:
          raise ValueError('DRUGBANK_USERNAME is not set and `username` was not passed')
  
      password = get_config('drugbank', 'password', passthrough=password)
      if password is None:
          raise ValueError('DRUGBANK_PASSWORD is not set and `password` was not passed')
  
      return ensure(
          *prefix,
          version,
          url=url,
          name='full database.xml.zip',
          download_kwargs=dict(
              backend='requests',
              stream=True,
              auth=(username, password),
          ),
      )
code_tokens: def download_drugbank ( username : Optional [ str ] = None , password : Optional [ str ] = None , version : Optional [ str ] = None , prefix : Union [ None , str , Sequence [ str ] ] = None , ) -> Path : if version is None : try : import bioversions except ImportError : raise ImportError ( 'must first `pip install bioversions` to get latest DrugBank version automatically' ) else : version = bioversions . get_version ( 'drugbank' ) url = f'https://go.drugbank.com/releases/{version.replace(".", "-")}/downloads/all-full-database' if prefix is None : prefix = [ 'drugbank' ] elif isinstance ( prefix , str ) : prefix = [ prefix ] username = get_config ( 'drugbank' , 'username' , passthrough = username ) if username is None : raise ValueError ( 'DRUGBANK_USERNAME is not set and `username` was not passed' ) password = get_config ( 'drugbank' , 'password' , passthrough = password ) if password is None : raise ValueError ( 'DRUGBANK_PASSWORD is not set and `password` was not passed' ) return ensure ( * prefix , version , url = url , name = 'full database.xml.zip' , download_kwargs = dict ( backend = 'requests' , stream = True , auth = ( username , password ) , ) , )
short_docstring: Download the given version of DrugBank.
short_docstring_tokens: Download the given version of DrugBank .
comment: """Download the given version of DrugBank.
  
      :param username:
          The DrugBank username. If not passed, looks up in the environment
          ``DRUGBANK_USERNAME``. If not found, raises a ValueError.
      :param password:
          The DrugBank password. If not passed, looks up in the environment
          ``DRUGBANK_PASSWORD``. If not found, raises a ValueError.
      :param version:
          The DrugBank version. If not passed, uses :mod:`bioversions` to
          look up the most recent version.
      :param prefix:
          The prefix and subkeys passed to :func:`pystow.ensure` to specify
          a non-default location to download the data to.
      """