Fabric-language-kotlin
Run:
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { kotlinOptions.jvmTarget = "17" }
// 1. Active Kotlin users val activeKotlinUsers = users.filter { it.isActive && it.preferences.language == "Kotlin" } println("\nActive Kotlin users: ${activeKotlinUsers.size}") activeKotlinUsers.take(3).forEach { println(" - ${it.fullName} (${it.email})") } fabric-language-kotlin
plugins { kotlin("jvm") version "1.9.22" application } repositories { mavenCentral() }
dependencies { implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3") } Run: tasks
# generate_data.py # Install fabric: pip install fabric from fabric import Fabricator import json import random from datetime import datetime, timedelta Define a simple data model using Fabric's declarative syntax user_fabricator = Fabricator( schema={ "user_id": "uuid", "full_name": "name", "email": "email", "age": {"type": "integer", "min": 18, "max": 90}, "signup_date": {"type": "date", "start": "2023-01-01", "end": "2025-12-31"}, "is_active": {"type": "boolean", "probability": 0.85}, "last_login": {"type": "datetime", "start": "2025-01-01", "end": "2025-04-14"}, "preferences": { "type": "dict", "schema": { "language": {"type": "choice", "choices": ["Kotlin", "Python", "Java", "Rust"]}, "notifications": "boolean" } } } )
Active users by language preference: Java: 198 Kotlin: 213 Python: 197 Rust: 192 "age": {"type": "integer"
if == " main ": generate_users(1000)