Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
J

jsf

> 后端框架
Open source

Creates fake JSON files from a JSON schema

200 stars0 likes2 views
WebsiteGitHub

About

Creates fake JSON files from a JSON schema

jsf

Use jsf along with fake data generators to provide consistent and meaningful fake data for your system.

Main Features

  • Provides out of the box data generation from any JSON schema
  • Extendable custom data providers using any lambda functions
  • Multi level state for dependant data (eg multiple objects sharing value, such as children with same surname)
  • Inbuilt validation of fake JSON produced ✅
  • In memory conversion from JSON Schema to Pydantic Models with generated examples
  • Seamless integration with FastAPI

Installation

Usage

Basic

python
from jsf import JSF

faker = JSF(
    {
        "type": "object",
        "properties": {
            "name": {"type": "string", "$provider": "faker.name"},
            "email": {"type": "string", "$provider": "faker.email"},
        },
        "required": ["name", "email"],
    }
)

fake_json = faker.generate()

Results in ...

python
{
    'name': 'Jesse Phillips', 
    'email': '[email protected]'
}

From JSON file

python
from jsf import JSF

faker = JSF.from_json("demo-schema.json")
fake_json = faker.generate()

Or run straight from the commandline...

Native install

bash
pip install jsf[cli]
jsf --schema jsf/tests/data/custom.json --instance wow.json

Docker

bash
docker run -v $PWD:/data challisa/jsf jsf --schema /data/custom.json --instance /data/example.json

FastAPI Integration

Create a file main.py with:

python
from jsf import JSF
from fastapi import FastAPI

app = FastAPI(docs_url="/")
generator = JSF.from_json("custom.json")

@app.get("/generate", response_model=generator.pydantic())
def read_root():
    return generator.generate()

Run the server with:

Partially supported features

  • string contentMediaType - only a subset of these are supported, however they can be expanded within this file

Credits

  • This repository is a Python port of json-schema-faker with some minor differences in implementation.

License

  • MIT License

Issues· 30 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythoncommandlinefakerfastapijsf

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架