Skip to content
 
 

Repository files navigation

Keploy Python Sample Applications

Introduction

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.

Table of Contents

Prerequisites

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.)

Python Sample Apps with Keploy

  1. 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.

  2. Django-Postgres - A user management application using Django and PostgreSQL for performing CRUD operations on user records.

  3. FastAPI-Postgres - A student management API built with FastAPI and PostgreSQL for CRUD operations on student data.

  4. FastAPI-Twilio - A SMS sending API built using FastAPI and Twilio services.

  5. Flask-Redis - A book management system using Flask with Redis for caching and storage, demonstrating optimized search functionality.

  6. Django-Mongo - An inventory management application using Django, MongoDB, mongoengine, and Django REST Framework.

  7. Flask-PostgreSQL - A Flask application integrated with PostgreSQL database.

  8. Sanic-Mongo - A movie management API built using Sanic framework and MongoDB for data storage.

  9. Sanic-Postgres - An employee management API built with Sanic framework and PostgreSQL.

Getting Started

To get started with any sample application:

  1. Install Keploy CLI:

    curl --silent -O -L https://keploy.io/install.sh && source install.sh
  2. Clone this repository:

    git clone https://github.com/keploy/samples-python.git
    cd samples-python
  3. Navigate to the sample application directory of your choice:

    cd <sample-app-directory>
  4. Follow the specific README.md instructions in that directory.

Running the Samples

Each sample application follows a similar pattern:

  1. Installation: Install dependencies and set up the required database
  2. Record Mode: Capture API calls using Keploy
  3. Test Mode: Run tests using the generated test cases

For detailed instructions, refer to the README.md file in each sample application directory.

Framework and Database Coverage

The samples in this repository cover a wide range of Python frameworks and databases:

Frameworks

  • Flask
  • Django
  • FastAPI
  • Sanic

Databases

  • MongoDB
  • PostgreSQL
  • Redis

Contributing

Contributions are welcome! If you'd like to submit a sample for another use-case, framework, or database integration, please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/new-sample)
  3. Commit your changes (git commit -m 'Add new sample for XYZ framework')
  4. Push to the branch (git push origin feature/new-sample)
  5. 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

Community Support ❤️

🤔 Questions?

Reach out to us. We're here to help!

Slack LinkedIn YouTube Twitter

💖 Let's Build Together!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages