podpac.authentication.EarthDataSession

class podpac.authentication.EarthDataSession(product_url='', **kwargs)

Bases: podpac.core.authentication.Session

Modified from: https://wiki.earthdata.nasa.gov/display/EL/How+To+Access+Data+With+Python overriding requests.Session.rebuild_auth to maintain headers when redirected

product_url

Url to NSIDC product OpenDAP server

Type

str

product_url_regex

Regex used to match redirected hostname if different from self.hostname

Type

str

Methods

__init__([product_url])

close()

Closes all adapters and as such the session

delete(url, **kwargs)

Sends a DELETE request.

get(url, **kwargs)

Sends a GET request.

get_adapter(url)

Returns the appropriate connection adapter for the given URL.

get_redirect_target(resp)

Receives a Response.

head(url, **kwargs)

Sends a HEAD request.

merge_environment_settings(url, proxies, …)

Check the environment and merge it with some settings.

mount(prefix, adapter)

Registers a connection adapter to a prefix.

options(url, **kwargs)

Sends a OPTIONS request.

patch(url[, data])

Sends a PATCH request.

post(url[, data, json])

Sends a POST request.

prepare_request(request)

Constructs a PreparedRequest for transmission and returns it.

put(url[, data])

Sends a PUT request.

rebuild_auth(prepared_request, response)

Overrides from the library to keep headers when redirected to or from the NASA auth host.

rebuild_method(prepared_request, response)

When being redirected we may want to change the method of the request based on certain specs or browser behavior.

rebuild_proxies(prepared_request, proxies)

This method re-evaluates the proxy configuration by considering the environment variables.

request(method, url[, params, data, …])

Constructs a Request, prepares it and sends it.

resolve_redirects(resp, req[, stream, …])

Receives a Response.

send(request, **kwargs)

Send a given PreparedRequest.

should_strip_auth(old_url, new_url)

Decide whether Authorization header should be removed when redirecting

update_login([username, password])

Summary

Attributes

auth

hostname

password

username

Members

__init__(product_url='', **kwargs)
auth = ()
hostname = None
password = None
rebuild_auth(prepared_request, response)

Overrides from the library to keep headers when redirected to or from the NASA auth host.

Parameters
  • prepared_request (requests.Request) – Description

  • response (requests.Response) – Description

Returns

Return type

None

update_login(username=None, password=None)

Summary

Parameters
  • username (str, optional) – Username input

  • password (str, optional) – Password input

username = None