PhotosAPI_Client/README.md

44 lines
1.6 KiB
Markdown
Raw Permalink Normal View History

2024-03-12 14:06:37 +02:00
# PhotosAPI_Client
Generated using [openapi-python-client](https://github.com/openapi-generators/openapi-python-client) client library for [PhotosAPI](https://git.end-play.xyz/profitroll/PhotosAPI)
## Usage
Please, refer to [library README](PhotosAPI_Client/README.md)
## 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:
2024-03-12 14:07:11 +02:00
* Generate: `openapi-python-client generate --config config.yaml --url "OPENAPI_SPEC_URL"` (replace `OPENAPI_SPEC_URL` with your URL)
2024-03-12 14:06:37 +02:00
* 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