10.8.6. Utilities for REST API Results

class pytan3.results.RestUrlPath(url)[source]

Bases: object

Parser to get path parts from a REST API URL.

__init__(url)[source]

Constructor.

Parameters:url (str) – URL to parse.
Raises:exceptions.ModuleError – If version and route can not be parsed from path_parts.
url_original = None

str – Original URL supplied.

url = None

str – Percent decoded version of url_original.

url_path = None

urllib.parse.ParseResult – Parsed version of url.

path_parts = None

list of str – Parts of URL split on /.

version = None

int – REST API version from path_parts.

route = None

str – REST API route from path_parts.

by_name = None

bool – If target is doing targeting by name or by id.

target = None

str – If found, target supplied for route in url.

__str__()[source]

Show object info.

Returns:str
__repr__()[source]

Show object info.

Returns:str