Creates fake JSON files from a JSON schema
Low maintenance activity. Last release over 2 years ago, commits in 0 of the last 26 weeks. Weaker on commit activity and recent releases.
$
pip install jsf
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
$ pip install jsf
---> 100%
Usage
Basic 😊
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 ...
{
'name': 'Jesse Phillips',
'email': 'xroberson@hotmail.com'
}
From JSON file 📁
from jsf import JSF
faker = JSF.from_json("demo-schema.json")
fake_json = faker.generate()
