This repository contains sample applications demonstrating Keploy's integration with various Python-based web frameworks and databases. Keploy is an API testing platform that automatically generates test cases and data mocks from API calls, making testing more efficient and comprehensive.
These samples showcase how to integrate Keploy with different Python web frameworks and databases, providing practical examples for your own projects. Each sample includes detailed setup instructions and demonstrates key Keploy features like test generation, data mocking, and test execution.
Note :- Issue Creation is disabled on this Repository, please visit here to submit Issue.
- Introduction
- Prerequisites
- Sample Applications
- Getting Started
- Running the Samples
- Contributing
- Community Support
Before running any sample application, make sure you have the following installed:
- Python 3.7+
- Keploy CLI
- Docker and Docker Compose (for applications using containers)
- Database systems as required by individual samples (MongoDB, PostgreSQL, Redis, etc.)
-
Flask-Mongo - A simple task management API built using Flask and MongoDB for data storage. It demonstrates CRUD operations on student records with CORS support.
-
Django-Postgres - A user management application using Django and PostgreSQL for performing CRUD operations on user records.
-
FastAPI-Postgres - A student management API built with FastAPI and PostgreSQL for CRUD operations on student data.
-
FastAPI-Twilio - A SMS sending API built using FastAPI and Twilio services.
-
Flask-Redis - A book management system using Flask with Redis for caching and storage, demonstrating optimized search functionality.
-
Django-Mongo - An inventory management application using Django, MongoDB, mongoengine, and Django REST Framework.
-
Flask-PostgreSQL - A Flask application integrated with PostgreSQL database.
-
Sanic-Mongo - A movie management API built using Sanic framework and MongoDB for data storage.
-
Sanic-Postgres - An employee management API built with Sanic framework and PostgreSQL.
To get started with any sample application:
-
Install Keploy CLI:
curl --silent -O -L https://keploy.io/install.sh && source install.sh
-
Clone this repository:
git clone https://github.com/keploy/samples-python.git cd samples-python -
Navigate to the sample application directory of your choice:
cd <sample-app-directory>
-
Follow the specific README.md instructions in that directory.
Each sample application follows a similar pattern:
- Installation: Install dependencies and set up the required database
- Record Mode: Capture API calls using Keploy
- Test Mode: Run tests using the generated test cases
For detailed instructions, refer to the README.md file in each sample application directory.
The samples in this repository cover a wide range of Python frameworks and databases:
- Flask
- Django
- FastAPI
- Sanic
- MongoDB
- PostgreSQL
- Redis
Contributions are welcome! If you'd like to submit a sample for another use-case, framework, or database integration, please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-sample) - Commit your changes (
git commit -m 'Add new sample for XYZ framework') - Push to the branch (
git push origin feature/new-sample) - Open a Pull Request
Please ensure your sample application includes:
- Clear setup and usage instructions
- Properly documented code
- Demonstration of Keploy's key features
- Tests showing Keploy integration
Reach out to us. We're here to help!