PhotosAPI_Client/README.md
2024-03-12 13:07:11 +01:00

1.6 KiB

PhotosAPI_Client

Generated using openapi-python-client client library for PhotosAPI

Usage

Please, refer to library README

Building / generating this Client

This project is separated into to parts:

  1. The generator (located where this README is)
  2. The generated library (located under PhotosAPI_Client/)

Generating

  1. Create a virtual environment .venv in the repository root:
    python -m venv .venv / virtualenv .venv
  2. Use this virtual environment:
    source .venv/bin/activate / .venv\Scripts\activate.ps1
  3. Install the dependencies:
    pip install -r requirements.txt
  4. Generate/update the client:
    • Generate: openapi-python-client generate --config config.yaml --url "OPENAPI_SPEC_URL" (replace OPENAPI_SPEC_URL with your URL)
    • Update: openapi-python-client update --config config.yaml --url "OPENAPI_SPEC_URL" (replace OPENAPI_SPEC_URL with your URL)

Building

  1. Create a virtual environment .venv in the repository root:
    python -m venv .venv / virtualenv .venv
  2. Use this virtual environment:
    source .venv/bin/activate / .venv\Scripts\activate.ps1
  3. Install the dependencies:
    pip install -r requirements.txt
  4. Build the client:
    python -m build ./PhotosAPI_Client
  5. Artifacts can be found under PhotosAPI_Client/dist

Generating and building with VSCode

  1. Steps about virtual environments MUST be completed first
  2. Use Terminal > Run Task to select the task you want to start