Metadata-Version: 2.5
Name: fastmock-api
Version: 0.1.2
Summary: A lightweight, local Mock server on FastAPI for frontend and mobile teams.
Requires-Python: >=3.12
Requires-Dist: faker>=19.0.0
Requires-Dist: fastapi>=0.100.0
Requires-Dist: jsonref>=1.1.0
Requires-Dist: pydantic-settings>=2.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-multipart>=0.0.9
Requires-Dist: pyyaml>=6.0
Requires-Dist: typer>=0.9.0
Requires-Dist: uvicorn>=0.23.0
Requires-Dist: websockets>=12.0
Provides-Extra: dev
Requires-Dist: httpx; extra == 'dev'
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: pytest-asyncio; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Description-Content-Type: text/markdown

<div align="right">
  <a href="README_RU.md">🇷🇺 Русский</a> | <b>🇬🇧 English</b>
</div>

# ⚡ FastMock API Engine

[![PyPI version](https://img.shields.io/pypi/v/fastmock-api.svg)](https://pypi.org/project/fastmock-api/)
[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
[![FastAPI](https://img.shields.io/badge/FastAPI-0.100+-009688.svg?logo=fastapi)](https://fastapi.tiangolo.com)
[![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?logo=docker&logoColor=white)](https://www.docker.com/)
[![Build Status](https://github.com/Artem-SPb/fastmock/actions/workflows/ci.yml/badge.svg)](https://github.com/Artem-SPb/fastmock/actions)

**FastMock** is a lightweight, local Mock server built on FastAPI. It's designed for frontend and mobile developers who need a reliable, realistic REST API instantly, without waiting for the backend team.

![FastMock Preview](docs/assets/preview.png) *(You can place the generated image here)*

## 🚀 Features at a glance
1. **Dynamic OpenAPI Ingestion**: Drop your `openapi.yaml` in the folder or upload via Admin API. The endpoints are generated on the fly.
2. **Realistic Payload Generation**: Automatically generates realistic data (names, emails, UUIDs, dates) based on JSON Schema types using `Faker`.
3. **In-Memory CRUD**: Remembers what you `POST` and returns it on `GET`.
4. **Chaos Engineering**: Simulate slow 3G networks or random server crashes (HTTP 500, 503) globally or per-request using HTTP headers.

## 📖 Detailed Documentation
For deep-dive instructions, check the full usage guide:
👉 **[Read the Full Documentation (English)](docs/USAGE_EN.md)**

## 🚀 Quick Start

### Option 1: Install via pip (Recommended)
```bash
pip install fastmock-api
fastmock --port 8080
```

> ⚠️ **Important Note for Windows Users:** The console might say `Uvicorn running on http://0.0.0.0:8080`. This means the server is accessible on your local network. However, Windows browsers **cannot** open `0.0.0.0` directly. Please use **[http://127.0.0.1:8080/docs](http://127.0.0.1:8080/docs)** instead.

### Option 2: Run via Docker
```bash
git clone https://github.com/Artem-SPb/fastmock.git
cd fastmock
docker compose up
```
Open **http://127.0.0.1:8000/docs** in your browser!

## 👨‍💻 Author
**Artem-SPb** 
- GitHub: [@Artem-SPb](https://github.com/Artem-SPb)

Created as a portfolio project showcasing modern Python architecture, FastAPI ecosystem, and Developer Experience (DX) best practices.

*Feel free to star ⭐ this repository if you found it helpful!*
