evercycle_api_runner.py

Interactive menu-driven runner for the Evercycle API.

Classes

class evercycle_api_runner.ApiEndpoint

Same lightweight data class as in api_runner.py.

path
description
method
url
content_type
headers
parameters
body_params
response_example
file_name
class evercycle_api_runner.EvercycleApiRunner(api_dir='./')

Interactive API runner.

load_endpoints() None

Load all *.md files from api_dir.

parse_markdown_file(file_path) ApiEndpoint | None

Parse a markdown spec using the same rules as ApiRunner.

display_menu() None

Print a numbered list of endpoints and prompt the user to select one. Choice 0 exits the application.

prepare_api_call(endpoint) None

Interactively collect parameters for the chosen endpoint and execute it.

Prompting order:

  1. Headers — one prompt per header declared in markdown.

  2. Path Parameters — extracted from {...} placeholders in path.

  3. Query Parameters — one prompt per parameter declared in markdown.

  4. Body Parameters — for POST/PUT/PATCH: * object/array types accept multi-line JSON input. * number types are coerced via float() (int if whole). * boolean types accept true/yes/1 as True. * All other types are stored as strings.

After collection, the method extracts the path from endpoint.url and calls ApiClient.call_endpoint().

run() None

Main loop: repeatedly display the menu until the user exits.

Functions

evercycle_api_runner.main()

Instantiate EvercycleApiRunner and start the interactive loop.