Instant mock APIs from a schema file — no server code required.
Project description
PyMockit
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pymockit-0.1.0.tar.gz.
File metadata
- Download URL: pymockit-0.1.0.tar.gz
- Upload date:
- Size: 66.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c1ac0bc8141ad3bb6afeda8720eee7ddad6c486eecca412e66d8acb201d0d76
|
|
| MD5 |
272c48bf852858488bad69c654a6a2c7
|
|
| BLAKE2b-256 |
30e7aa594c2313029ebdfd10f87193f4b88b5ac1110b0fc435a3deca4831bc85
|
Provenance
The following attestation bundles were made for pymockit-0.1.0.tar.gz:
Publisher:
publish.yml on gabrielleaosb/pymockit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pymockit-0.1.0.tar.gz -
Subject digest:
0c1ac0bc8141ad3bb6afeda8720eee7ddad6c486eecca412e66d8acb201d0d76 - Sigstore transparency entry: 1462510694
- Sigstore integration time:
-
Permalink:
gabrielleaosb/pymockit@78b9fc9c3b4a55ed8352f79a41af07479327d4ac -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/gabrielleaosb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@78b9fc9c3b4a55ed8352f79a41af07479327d4ac -
Trigger Event:
push
-
Statement type:
File details
Details for the file pymockit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pymockit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6c03189841925fdafa4cd1c67bc66d712df7045d1943e2d128647bc46c7cc49
|
|
| MD5 |
5ccc069bafcd4a0ceb156ad47968fb58
|
|
| BLAKE2b-256 |
449c54e6a8e6bfd6b9788d620e057ecae83c6609d9071c0adf4fe6aec5a23f86
|
Provenance
The following attestation bundles were made for pymockit-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on gabrielleaosb/pymockit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pymockit-0.1.0-py3-none-any.whl -
Subject digest:
a6c03189841925fdafa4cd1c67bc66d712df7045d1943e2d128647bc46c7cc49 - Sigstore transparency entry: 1462510710
- Sigstore integration time:
-
Permalink:
gabrielleaosb/pymockit@78b9fc9c3b4a55ed8352f79a41af07479327d4ac -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/gabrielleaosb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@78b9fc9c3b4a55ed8352f79a41af07479327d4ac -
Trigger Event:
push
-
Statement type: