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
*.mdfiles fromapi_dir.
- parse_markdown_file(file_path) ApiEndpoint | None
Parse a markdown spec using the same rules as
ApiRunner.
Print a numbered list of endpoints and prompt the user to select one. Choice
0exits the application.
- prepare_api_call(endpoint) None
Interactively collect parameters for the chosen endpoint and execute it.
Prompting order:
Headers — one prompt per header declared in markdown.
Path Parameters — extracted from
{...}placeholders inpath.Query Parameters — one prompt per parameter declared in markdown.
Body Parameters — for POST/PUT/PATCH: *
object/arraytypes accept multi-line JSON input. *numbertypes are coerced viafloat()(int if whole). *booleantypes accepttrue/yes/1as True. * All other types are stored as strings.
After collection, the method extracts the path from
endpoint.urland callsApiClient.call_endpoint().
- run() None
Main loop: repeatedly display the menu until the user exits.
Functions
- evercycle_api_runner.main()
Instantiate
EvercycleApiRunnerand start the interactive loop.