{"id":20791450,"url":"https://github.com/keploy/python-sdk","last_synced_at":"2025-05-05T21:22:28.113Z","repository":{"id":40549258,"uuid":"463640564","full_name":"keploy/python-sdk","owner":"keploy","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-23T11:39:15.000Z","size":60,"stargazers_count":11,"open_issues_count":2,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T23:51:08.125Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keploy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-25T18:42:36.000Z","updated_at":"2024-07-23T11:39:19.000Z","dependencies_parsed_at":"2024-03-28T08:28:28.539Z","dependency_job_id":"7776d044-9c8e-458f-8689-de40cd37d30a","html_url":"https://github.com/keploy/python-sdk","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":"keploy/template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keploy%2Fpython-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keploy%2Fpython-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keploy%2Fpython-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keploy%2Fpython-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keploy","download_url":"https://codeload.github.com/keploy/python-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252577176,"owners_count":21770750,"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":[],"created_at":"2024-11-17T15:44:43.632Z","updated_at":"2025-05-05T21:22:28.065Z","avatar_url":"https://github.com/keploy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen?logo=github)](CODE_OF_CONDUCT.md)\n[![Slack](.github/slack.svg)](https://join.slack.com/t/keploy/shared_invite/zt-12rfbvc01-o54cOG0X1G6eVJTuI_orSA)\n[![License](.github/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n**Note** :- Issue Creation is disabled on this Repository, please visit [here](https://github.com/keploy/keploy/issues/new/choose) to submit issue.\n\n# Keploy Python-SDK\nThis is the client SDK for the [Keploy](https://github.com/keploy/keploy) testing platform. With the Python SDK, you can test both your existing unit test cases in Pytest and create new end-to-end test cases for your applications.\nThe **HTTP mocks/stubs and tests are the same format** and inter-exchangeable.\n\n## Contents\n1. [Installation](#installation)\n2. [Usage](#usage)\n3. [Community support](#community-support)\n\n## Installation\n1. First you need to install [Python(version 3 and above)](https://www.python.org/downloads/)\n\n2. Install the Python-SDK and also Python's coverage library via pip.\n\n```bash\npip install keploy coverage\n```\n\n3. Install Keploy from [here](https://github.com/keploy/keploy?tab=readme-ov-file#-quick-installation)\n\n## Usage\nKeploy simplifies the testing process by seamlessly generating end-to-end test cases without the need to write unit test files and manage mocks/stubs.\n\nAdd a test file with the following code to the directory with all your existing tests. This will help us to get the coverage of Keploy's API tests along with the other unit tests. We can call this `test_keploy.py`\n\n```python\nfrom keploy import run\ndef test_keploy():\n    run(\"python3 -m coverage run --data-file=.coverage_data.keploy \u003ccommand-to-run-your-application\u003e\")\n```\n\n\u003e Note: If you face any problems with running the coverage library, you can refer to the documentation for the same [here](https://coverage.readthedocs.io/en/7.4.2/cmd.html#execution-coverage-run)\n\nTo ignore the coverage of python libraries which are included in the report by default, you need to create a `.coveragerc` file in the directory where you will ignore the /usr/ directory(only for Linux users). The contents of the file will be as follows:\n\n```bash\n[run]\nomit =\n    /usr/*\nsigterm = true\n```\n\nBefore starting your application, make sure that the **debug mode is set to False** in your application, for the coverage library to work properly.\n\nNow to run this testcase along with your another unit testcases, you can run the command below:\n\n```bash\nkeploy test -c \"python3 -m coverage run -p --data-file=.coverage.unit -m pytest test_keploy.py \u003cyour-unit-test-file\u003e\" --delay 10 --coverage\n```\n\nNow, to combine the coverage from the unit tests, and Keploy's API tests, we can use the command below:\n\n```bash\npython3 -m coverage combine\n```\n\nMake sure to run this command before starting a new test run to avoid getting multiple coverage files.\n\nFinally, to generate the coverage report for the test run, you can run:\n\n```bash\npython3 -m coverage report\n```\n\nand if you want the coverage in an html file, you can run:\n\n```bash\npython3 -m coverage html\n```\n\nHooray🎉! You've sucessfully got the coverage of your Keploy recorded api tests using Pytest.\n\n## Community support\nWe'd love to collaborate with you to make Keploy.io great. To get started:\n* [Slack](https://join.slack.com/t/keploy/shared_invite/zt-12rfbvc01-o54cOG0X1G6eVJTuI_orSA) - Discussions with the community and the team.\n* [GitHub](https://github.com/keploy/keploy/issues) - For bug reports and feature requests.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeploy%2Fpython-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeploy%2Fpython-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeploy%2Fpython-sdk/lists"}