argopy.set_options#

class set_options(**kwargs)[source]#

Set options for argopy

List of options:

  • dataset: Define the Dataset to work with.

    Default: phy. Possible values: phy, bgc or ref.

  • src: Source of fetched data.

    Default: erddap. Possible values: erddap, gdac, argovis

  • mode: User mode.

    Default: standard. Possible values: standard, expert or research.

  • ftp: Default path to be used by the GDAC fetchers and Argo index stores

    Default: https://data-argo.ifremer.fr

  • erddap: Default server address to be used by the data and index erddap fetchers

    Default: https://erddap.ifremer.fr/erddap

  • cachedir: Absolute path to a local cache directory.

    Default: ~/.cache/argopy

  • cache_expiration: Expiration delay of cache files in seconds.

    Default: 86400

  • api_timeout: Define the time out of internet requests to web API, in seconds.

    Default: 60

  • trust_env: Allow for local environment variables to be used to connect to the internet.

    Default: False. Argopy will get proxies information from HTTP_PROXY / HTTPS_PROXY environment variables if this option is True and it can also get proxy credentials from ~/.netrc file if this file exists.

  • user/password: Username and password to use when a simple authentication is required.

    Default: None, None

  • server: Other than expected/default server to be uses by a function/method. This is mostly intended to be used for unit testing

    Default: None

You can use set_options either as a context manager for temporary setting:

>>> import argopy
>>> with argopy.set_options(src='gdac'):
>>>    ds = argopy.DataFetcher().float(3901530).to_xarray()

or to set global options (at the beginning of a script for instance):

>>> argopy.set_options(src='gdac')
__init__(**kwargs)[source]#

Methods

__init__(**kwargs)