High-performance database generator with realistic fake data
Generate databases from JSON schemas with realistic fake data. 10-50x faster than pure Python/JavaScript implementations thanks to a Go core with zero-dependency wrappers for Python and Node.js.
- π Schema-Driven - Define tables and data in simple JSON format
- β‘ High Performance - Go core delivers 10-50x speed improvement
- π‘ Realistic Data - 50+ generators for names, emails, addresses, dates, and more
- ποΈ Multi-Database - Works with SQLite, MySQL, and PostgreSQL
- π― Simple API - Easy CLI and programmatic usage
- π Cross-Platform - Linux, macOS, Windows (amd64 & arm64)
- π¦ Multi-Ecosystem - Available on PyPI, npm, and Homebrew
- π§ Zero Dependencies - Self-contained with bundled binaries
Choose your preferred package manager:
Python (pip)
pip install fakestackNode.js (npm)
npm install fakestackHomebrew (macOS/Linux)
brew install 0xdps/fakestackGo (from source)
cd golang && go buildDirect Download
Pre-built binaries available on GitHub Releases
fakestack -d .This creates a schema.json file in the current directory.
# All in one command
fakestack -c -p -f schema.json
# Or separately
fakestack -c -f schema.json # Create tables
fakestack -p -f schema.json # Populate datasqlite3 test.db "SELECT * FROM users LIMIT 5;"fakestack [OPTIONS]
Options:
-c, --create-table Create database tables from schema
-p, --populate-data Populate tables with fake data
-f, --file <path> Path to JSON schema file
-d, --download-schema Download example schema
-h, --help Display help messagefrom fakestack import fakestack
# Generate database
exit_code = fakestack(['-c', '-p', '-f', 'schema.json'])
# Or use run_fakestack
from fakestack import run_fakestack
run_fakestack(['-d', '.']) # Download schema
run_fakestack(['-c', '-p', '-f', 'schema.json']) # Generate// CommonJS
const { fakestack } = require('fakestack');
// ES Modules
import { fakestack } from 'fakestack';
// Generate database
await fakestack(['-c', '-p', '-f', 'schema.json']);
// TypeScript with options
import { fakestack, FakestackOptions } from 'fakestack';
const options: FakestackOptions = {
createTables: true,
populateData: true,
schemaFile: 'schema.json'
};
await fakestack(options);Create a schema.json file defining your database structure:
{
"database": {
"dbtype": "sqlite",
"drivername": "sqlite",
"database": "test.db"
},
"tables": [
{
"name": "users",
"columns": [
{
"name": "id",
"type": "integer",
"options": {"primary_key": true, "autoincrement": true}
},
{
"name": "username",
"type": {"name": "string", "args": {"length": 50}},
"options": {"nullable": false, "unique": true}
},
{
"name": "email",
"type": {"name": "string", "args": {"length": 100}},
"options": {"nullable": false, "unique": true}
},
{
"name": "created_at",
"type": "datetime",
"options": {"nullable": false}
}
]
}
],
"populate": [
{
"name": "users",
"count": 100,
"fields": [
{"name": "username", "generator": "user_name"},
{"name": "email", "generator": "email"},
{"name": "created_at", "generator": "past_date"}
]
}
]
}first_name,last_name,nameemail,user_name,passwordphone_number,ssn
address,street_addresscity,state,countrypostcode,latitude,longitude
company,company_suffixjob,catch_phrase
url,domain_nameipv4,ipv6,mac_addressuser_agent,slug
date,date_timepast_date,future_datetime,unix_time
text,sentence,paragraphword,words
random_int,random_digitrandom_number,random_float
person- Complete person objectuser- User credentials objectrandom_from- Pick from provided listuuid- Generate UUID
| Database | Driver | Connection String Example |
|---|---|---|
| SQLite | sqlite |
sqlite:///path/to/database.db |
| MySQL | mysql+mysqlconnector |
mysql+mysqlconnector://user:pass@host/db |
| PostgreSQL | postgresql+psycopg2 |
postgresql+psycopg2://user:pass@host/db |
{
"database": {
"dbtype": "sqlite",
"drivername": "sqlite",
"database": "myapp.db"
}
}{
"database": {
"dbtype": "mysql",
"drivername": "mysql+mysqlconnector",
"username": "root",
"password": "password",
"host": "localhost",
"port": 3306,
"database": "myapp"
}
}{
"database": {
"dbtype": "postgresql",
"drivername": "postgresql+psycopg2",
"username": "postgres",
"password": "password",
"host": "localhost",
"port": 5432,
"database": "myapp"
}
}- Getting Started - Installation and basic usage
- Schema Reference - Complete schema documentation
- Data Generators - All available data generators
- Database Support - Database-specific configuration
- API Reference - Python and Node.js APIs
- Examples - Real-world examples
- Troubleshooting - Common issues and solutions
- Python Package - Python-specific documentation
- Node.js Package - Node.js/TypeScript documentation
- Go Core - Go core documentation
Fakestack's Go core delivers exceptional performance:
| Dataset | Python v2.0 | Go Core v2.1 | Speedup |
|---|---|---|---|
| 1K rows | ~2.5s | ~0.1s | 25x |
| 10K rows | ~25s | ~0.8s | 31x |
| 100K rows | ~250s | ~6s | 42x |
Benchmarks run on: MacBook Pro M1, 16GB RAM, SQLite database
fake-stack/
βββ golang/ # Go core implementation
β βββ *.go # Source files
β βββ Formula/ # Homebrew formula
β βββ README.md # Go documentation
βββ python/ # Python package (PyPI: fakestack)
β βββ fakestack/ # Python module
β βββ tests/ # Integration tests
β βββ README.md # Python documentation
βββ node/ # Node.js package (npm: fakestack)
β βββ src/ # TypeScript source
β βββ tests/ # Integration tests
β βββ README.md # Node.js documentation
βββ docs/ # Documentation
βββ bin/ # Compiled binaries
βββ scripts/ # Build scripts
Contributions welcome! See CONTRIBUTING.md for guidelines.
Go Core:
cd golang
go mod download
go build
go test -v ./...Python:
cd python
pip install -e ".[dev]"
pytest tests/ -v
black fakestack/Node.js:
cd node
npm install
npm test
npm run build# Go tests
cd golang && go test -v ./...
# Python tests (all versions: 3.8-3.13)
cd python && pytest tests/ -v
# Node.js tests (Node 18+)
cd node && npm testMIT License - see LICENSE file for details.
Built with:
- gofakeit - Go fake data generation
- go-sqlite3 - SQLite driver
- go-mysql-driver - MySQL driver
- pq - PostgreSQL driver
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
- π¦ PyPI: https://pypi.org/project/fakestack/
- π¦ npm: https://www.npmjs.com/package/fakestack
- πΊ Homebrew:
brew install 0xdps/fakestack
See CHANGELOG.md for version history and release notes.
Made with β€οΈ by Devendra Pratap