Skip to main content

PyMockit

CI PyPI Python License: MIT

Instant mock APIs from a schema file — no server code required.

pymockit run schema.json

In seconds you have a fully functional FastAPI mock server with Swagger UI, realistic fake data, and hot-reload.


Install

pip install pymockit
# or with uv
uv add pymockit

Quick start

# 1. Generate a starter schema
pymockit init

# 2. Start the mock server
pymockit run schema.json

# 3. With hot-reload and a custom port
pymockit run schema.json --port 8080 --reload

# 4. Validate without starting
pymockit validate schema.json

Schema format

{
  "routes": [
    {
      "path": "/users",
      "method": "GET",
      "_status": 200,
      "body": {
        "id": "@faker.uuid4",
        "name": "@faker.name",
        "email": "@faker.email",
        "age": "@faker.random_int",
        "company": "@faker.company"
      }
    },
    {
      "path": "/users/{id}",
      "method": "GET",
      "_status": 200,
      "body": { "id": "@faker.uuid4", "name": "@faker.name" }
    },
    {
      "path": "/products",
      "method": "POST",
      "_status": 201,
      "body": { "created": true, "product_id": "@faker.uuid4" }
    },
    {
      "path": "/broken",
      "method": "GET",
      "_status": 404,
      "body": { "error": "Resource not found" }
    }
  ]
}

Rules

Feature Description
@faker.<method> Any Faker method — resolved fresh per request
_status HTTP status code (default 200)
{param} Path parameters passed through to FastAPI
Literal values Strings, numbers, booleans, arrays — returned as-is

Commands

pymockit run <schema>

Start the mock server.

Option Default Description
--host 127.0.0.1 Bind address
--port 8000 TCP port
--reload off Restart on schema file change

pymockit init

Create a schema.json starter in the current directory.

pymockit validate <schema>

Check a schema for errors without starting the server. Exits 0 on success, 1 on error.


License

MIT

Metadata

Release files for pymockit 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymockit 0.1.0
File Size Uploaded
pymockit-0.1.0.tar.gz 66.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pymockit 0.1.0
File Interpreter ABI Platform
pymockit-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 78.3 kB

Release files / pymockit-0.1.0.tar.gz

Download URL pymockit-0.1.0.tar.gz
Size 66.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0c1ac0bc8141ad3bb6afeda8720eee7ddad6c486eecca412e66d8acb201d0d76
BLAKE2b-256 checksum
How to use checksums
30e7aa594c2313029ebdfd10f87193f4b88b5ac1110b0fc435a3deca4831bc85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 7, 2026.

Transparency log

Release files / pymockit-0.1.0-py3-none-any.whl

Download URL pymockit-0.1.0-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6c03189841925fdafa4cd1c67bc66d712df7045d1943e2d128647bc46c7cc49
BLAKE2b-256 checksum
How to use checksums
449c54e6a8e6bfd6b9788d620e057ecae83c6609d9071c0adf4fe6aec5a23f86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page