pygleif.v2.base.Transport

class pygleif.v2.base.Transport(base_url='https://api.gleif.org/api/v1')[source]

Perform GET requests against the GLEIF JSON API, sync or async.

Parameters:

base_url (str)

__init__(base_url='https://api.gleif.org/api/v1')[source]

Init the transport with a configurable base URL.

Parameters:

base_url (str)

Return type:

None

Methods

__aenter__()

Enter the async context manager.

__aexit__(*exc_info)

Close the async client on context exit.

__delattr__(name, /)

Implement delattr(self, name).

__dir__()

Default dir() implementation.

__enter__()

Enter the sync context manager.

__eq__(value, /)

Return self==value.

__exit__(*exc_info)

Close the sync client on context exit.

__format__(format_spec, /)

Default object formatter.

__ge__(value, /)

Return self>=value.

__getattribute__(name, /)

Return getattr(self, name).

__getstate__()

Helper for pickle.

__gt__(value, /)

Return self>value.

__hash__()

Return hash(self).

__init__([base_url])

Init the transport with a configurable base URL.

__init_subclass__()

This method is called when a class is subclassed.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(*args, **kwargs)

__reduce__()

Helper for pickle.

__reduce_ex__(protocol, /)

Helper for pickle.

__repr__()

Return repr(self).

__setattr__(name, value, /)

Implement setattr(self, name, value).

__sizeof__()

Size of object in memory, in bytes.

__str__()

Return str(self).

__subclasshook__(object, /)

Abstract classes can override this to customize issubclass().

_build_url(path[, params, base_url])

Compose a full request URL with an encoded query string.

_map_status_error(exc)

Map an httpx status error to the v2 error hierarchy.

aclose()

Close the underlying async client, if one was created.

aget(path[, params])

Issue an async GET request and return the decoded JSON body.

aget_raw(path[, params, base_url])

Issue an async GET request and return the raw response body.

close()

Close the underlying sync client, if one was created.

get(path[, params])

Issue a GET request and return the decoded JSON body.

get_raw(path[, params, base_url])

Issue a GET request and return the raw response body.

Attributes

TIMEOUT_SECOND

__annotations__

__dict__

__doc__

__firstlineno__

__module__

__static_attributes__

__weakref__

list of weak references to the object

async_client

Return the lazily-created httpx.AsyncClient.

client

Return the lazily-created sync httpx.Client.