Skip to main content

A zero-dependency, sophisticated mock HTTP server for development and testing

Project description

Imitatus

A sophisticated mock HTTP server for development and testing. Imitatus (Latin for "imitation") provides a powerful way to simulate HTTP services with precision and flexibility.

Python Version License

Features

  • 🔐 Token-based authentication system
  • 🎯 Full HTTP method coverage (GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS, TRACE, CONNECT)
  • 💾 Intelligent in-memory state management
  • 📊 Request logging and analytics
  • 🛡️ CORS support out of the box
  • 🧪 Ready-to-use test collection
  • ⚡ Zero external dependencies

Quick Start

# Install
git clone https://github.com/serkanaltuntas/imitatus.git
cd imitatus
pip install -r requirements.txt

# Run
python -m imitatus.server --port 8000

Basic Usage

  1. Start the server:
python -m imitatus.server
  1. Authenticate:
curl -X POST http://localhost:8000/api/login \
  -H "Content-Type: application/json" \
  -d '{"username": "admin", "password": "password"}'
  1. Make requests:
curl http://localhost:8000/api/items \
  -H "Authorization: Bearer your-token-here"

API Overview

Authentication

  • POST /api/login: Get authentication token
{
  "username": "admin",
  "password": "password"
}

Core Endpoints

  • GET /api/items: List all items
  • POST /api/items: Create item
  • GET /api/items/{id}: Get specific item
  • PUT /api/items/{id}: Full update
  • PATCH /api/items/{id}: Partial update
  • DELETE /api/items/{id}: Delete item

System Endpoints

  • GET /debug/vars: System state and metrics
  • OPTIONS /api/items: Available methods and API info

Dependencies

Prerequisites

  • Python 3.8+
  • pip

Production

Imitatus is designed to have zero production dependencies. It uses only Python's standard library components for all core functionality. This design choice provides several benefits:

  • 🔒 Enhanced security with no third-party dependency risks
  • ⚡ Fast and lightweight installation
  • 🎯 No version conflicts with other packages
  • 📦 Maximum portability across Python environments

Development

For development and testing, we use several high-quality tools:

# Install development dependencies
pip install -r requirements-dev.txt

# Install testing dependencies
pip install -r requirements-test.txt

See requirements-dev.txt and requirements-test.txt for the complete list of development and testing dependencies.

Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Built with precision by Serkan Altuntas

Support

  • Submit issues via GitHub
  • Review documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

imitatus-0.1.1.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

imitatus-0.1.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file imitatus-0.1.1.tar.gz.

File metadata

  • Download URL: imitatus-0.1.1.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for imitatus-0.1.1.tar.gz
Algorithm Hash digest
SHA256 73cec7c423b1c319de82776130d557f3ec3c346d14ea7f1a3c099964cc0c475f
MD5 d7dd6fc64f4613398810c203cf4cdba0
BLAKE2b-256 c6b507007642f71be9096366cc3d8669ca0f976d2e7b4095491a4fa045cdbf29

See more details on using hashes here.

File details

Details for the file imitatus-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: imitatus-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for imitatus-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 274b94e3f23fe2aeb991d927b31dd90fc9fcf8bc9abbae69442b0c0c525d181b
MD5 b2b9f26dab09df5dffc898e4dc40524a
BLAKE2b-256 4390db2641d1b46ca7c4c7c3daf9c437bc621a39b04feaf26720f3782540d2c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page