API

make script

src.make_client.convert_to_snake_case(name: str) → str[source]

via https://stackoverflow.com/a/1176023

src.make_client.create_client_endpoints(swagger_data, api_paths)[source]
src.make_client.seems_like_a_url(url)[source]

is_url https://stackoverflow.com/a/52455972/10124294

src.make_client.main(config_path=None)[source]

control flow

Client Template

src.client_template.client_imports_f() → str[source]

Creates the string to import the client dependencies and a default module doc string. Usually the first part of the client module.

Returns

import statements string ready to be appended to client module

Return type

str

src.client_template.client_class_def_template_f(args: Dict[str, Any]) → str[source]
Parameters

args (dict) – desired name of client class name default:MyApiClient

Returns

class definition string ready to be appended to client-module

Return type

str

src.client_template.client_point_of_execution_f() → str[source]

The idea is to separate details of the endpoint and transmitting the request. status_code handling could be placed or called here

src.client_template.client_encoding_decoding_point_f() → str[source]

provides method code to encode and decode response data

src.client_template.client_method_template_f(method_name: str = '', http_verb: str = '', api_path: str = '', doc_string: str = '', path_params_list: List[str] = None) → str[source]

one size fits most method template

Parameters
  • http_verb (str) – GET, POST, PUT, DELETE and PATCH

  • method_name (str) – a valid python function name as a string

  • api_path (str) – a valid URL part which is joined with the BASE_PATH. Can contain path parameters. Will be evaluated to a string.

  • doc_string (str) – some description of the method and or endpoint

  • path_params_list (str) – e.g. pagination is frequently used in the path

Returns

a method code string ready to be appended to python-client-module

Return type

str