{"id":20364368,"url":"https://github.com/bandwidth/pypony","last_synced_at":"2025-04-12T04:41:42.666Z","repository":{"id":215119620,"uuid":"463220540","full_name":"Bandwidth/pypony","owner":"Bandwidth","description":"A magical python CLI tool to contract test an API against its OAS","archived":false,"fork":false,"pushed_at":"2024-04-12T04:24:27.000Z","size":4975,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":30,"default_branch":"main","last_synced_at":"2024-04-14T06:09:00.877Z","etag":null,"topics":["api","contract-testing","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pypony/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bandwidth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-02-24T16:30:35.000Z","updated_at":"2024-04-16T07:26:58.107Z","dependencies_parsed_at":"2024-04-16T07:26:54.341Z","dependency_job_id":"b6d49ce8-782b-4f25-93aa-f448d9a407e8","html_url":"https://github.com/Bandwidth/pypony","commit_stats":null,"previous_names":["bandwidth/pypony"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bandwidth%2Fpypony","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bandwidth%2Fpypony/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bandwidth%2Fpypony/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bandwidth%2Fpypony/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bandwidth","download_url":"https://codeload.github.com/Bandwidth/pypony/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248519304,"owners_count":21117756,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","contract-testing","python"],"created_at":"2024-11-15T00:11:26.302Z","updated_at":"2025-04-12T04:41:42.646Z","avatar_url":"https://github.com/Bandwidth.png","language":"Python","readme":"# PyPony\n\n![PyPony Logo](https://github.com/Bandwidth/pypony/blob/main/PyPony.png)\n\nPyPony is a 🪄magical🪄 Python CLI tool for contract testing OpenAPI specifications against the live APIs that they define.\n\n[![Unit Tests](https://github.com/Bandwidth/pypony/actions/workflows/ci.yml/badge.svg)](https://github.com/Bandwidth/pypony/actions/workflows/ci.yml)\n\n```sh\npip install pypony\n```\n\n## Supported OAS Features\n\n* JSON or YAML\n* enums\n* $ref\n* oneOf\n\n## Install Locally\n\n```shell\nmake install-dependencies\nmake install-cli\n```\n\n## Remove Local Installation\n\n```shell\nmake remove-cli\n```\n\n## Test\n\n```shell\nmake test\n```\n\n### Generate Coverage Report\n```shell\nmake test-coverage\n```\n\n## Run\n\n```shell\npypony -st ./my_steps.yml -sp ./my_spec.yml  -v\n```\n\n### Arguments\n\n|       Argument       | Description                                                          |\n|:--------------------:|:---------------------------------------------------------------------|\n|   '-st', '--step'    | Relative path to step file                                           |\n|   '-sp', '--spec'    | Relative path to spec file                                           |\n|  '-v', '--verbose'   | Boolean verbose output (default=`False`)                             |\n| '-ff', '--fail-fast' | Option to fail fast if an exception is encountered (default=`False`) | # Coming soon!\n\n## Step File\n\nThe `step` file is what is used to make API calls - its where you provide information like base url, auth, path, request body, etc. PyPony uses the information in the step file to check against the OpenAPI spec, ensuring it matches the definiution, and then sends it using the [requests](https://pypi.org/project/requests/) library.\n\nStep files export expressions and environment variables, allowing it to be run in a CI/CD pipeline and making data from previous steps accessible.\n\n### Required Step File Fields\n\n* BaseURL\n* Steps\n  * name\n  * operation_id\n  * method\n  * path\n  * status_code\n\n### Example Step File\n\n```yml\n---\nbase_url: https://voice.bandwidth.com/api/v2\nauth:\n    username: ${{ env.BW_USERNAME }}\n    password: ${{ env.BW_PASSWORD }}\nsteps:\n  - name: createCall\n    operation_id: createCall\n    method: POST\n    path: /accounts/${{ env.BW_ACCOUNT_ID }}/calls\n    headers:\n      Content-Type: application/json\n    body:\n      to: ${{ env.USER_NUMBER }}\n      from: ${{ env.BW_NUMBER }}\n      applicationId: ${{ env.BW_VOICE_APPLICATION_ID }}\n      answerUrl: ${{ env.BW_ANSWER_URL }}\n    status_code: 201\n\n  - name: Get Call Info\n    operation_id: getCallState\n    method: GET\n    path: /accounts/${{ env.BW_ACCOUNT_ID }}/calls/${{ steps.createCall.response.data.callId }}\n    auth:    # overrides global auth definition\n        username: ${{ env.VOXBONE_USERNAME }}\n        password: ${{ env.VOXBONE_PASSWORD }}\n    status_code: 200\n\n  - name: listConferences\n    operation_id: listConferences\n    method: GET\n    path: /accounts/${{ env.BW_ACCOUNT_ID }}/conferences\n    status_code: 200\n```\n\nThe full step file schema can be found [here](https://github.com/Bandwidth/pypony/blob/main/src/steps_schema.yml).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbandwidth%2Fpypony","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbandwidth%2Fpypony","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbandwidth%2Fpypony/lists"}