Skip to content

lupeke/hort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hort

A command-line tool to generate a Python API client from an OpenAPI (Swagger) specification.

Installation

python3 -m venv .venv && \
source .venv/bin/activate && \
pip install .

Usage

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_tools

This will generate a client.py file in the my_tools directory.

Development

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-httpx

Running Tests

To 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

About

Create Python clients from OpenAPI specs

Resources

Stars

Watchers

Forks

Languages