argopy.set_options

argopy.set_options#

class set_options(**kwargs)[source]#

Set options for argopy

Parameters:
  • dataset (str, default: 'phy') –

    Define the Dataset to work with: phy, bgc or ref

    Deprecated since version 0.1.17:

    • Replaced by ds in versions >= v0.1.18

  • src (str, default: 'erddap') – Source of fetched data: erddap, gdac, argovis

  • mode (str, default: 'standard') – User mode: standard, expert or research

  • ftp (str, default: β€˜https://data-argo.ifremer.fr’) –

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

    Deprecated since version 0.1.17:

    • Replaced by gdac in versions >= v0.1.18

  • erddap (str, default: β€˜https://erddap.ifremer.fr/erddap’) – Default server address to be used by the data and index erddap fetchers

  • cachedir (str, default: '~/.cache/argopy') – Absolute path to a local cache directory

  • cache_expiration (int, default: 86400) – Expiration delay of cache files in seconds

  • api_timeout (int, default: 60) – Time out for internet requests to web API, in seconds

  • trust_env (bool, default: False) –

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

    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 (str, default: None) – Username to use when a simple authentication is required

  • password (str, default: None) – Password to use when a simple authentication is required

  • argovis_api_key (str, default:'guest') –

    The API key to use when fetching data from the argovis data source

    You can get a free key at https://argovis-keygen.colorado.edu

  • server (: str, default: None) –

    Other than expected/default server to be uses by a function/method

    This is mostly intended to be used for unit testing

Examples

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')
Warns:

A DeprecationWarning can be raised when a deprecated option is set

__init__(**kwargs)[source]#

Methods

__init__(**kwargs)