A command-line tool to generate a Python API client from an OpenAPI (Swagger) specification.
python3 -m venv .venv && \
source .venv/bin/activate && \
pip install .To generate a client, run the hort command with the path to your OpenAPI spec file.
hort <path-to-spec.json> --output-dir <path-to-output-dir>Example:
hort swagger.json --output-dir my_toolsThis will generate a client.py file in the my_tools directory.
To set up the development environment, create a virtual environment and install the dependencies:
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
pip install pytest pytest-httpxTo run the test suite, call pytest in the root folder or each test individually:
pytest tests/test_end_to_end.py
pytest tests/test_generator.py
pytest tests/test_parser.py