$ show lk-geimfari/mimesis
Mimesis is a Python library for generating high-quality, locale-aware fake data, intended for use in testing, database seeding, API mocking, and data anonymization. Unlike simpler lorem-ipsum generators, it produces realistic names, addresses, dates, financial data, internet-related strings, and more, across 47 locale variants. The architecture is modular: locale-independent and locale-dependent providers (e.g., Person, Address, Internet) load curated JSON datasets, while a suite of schema tools (Field, Fieldset, Schema, SchemaBuilder) allows declarative generation of flat or relational synthetic datasets with lazy evaluation, dependency resolution, and export to CSV/JSON/pickle. A custom Random class with weighted selection and deterministic seeding ensures reproducibility, and optional plugins integrate with factory_boy and pytest-randomly. The codebase is well-structured, extensively typed (mypy strict), and thoroughly tested, with a strong emphasis on performance (~20-30x faster than comparable libraries like Faker). External runtime dependencies are minimal; the only optional ones are pytz and factory-boy.
The LLM identified 3 files worth highlighting for reuse:
Provides composable, pure functions (pipe, wrap, slugify, romanize, redact, etc.) that transform generated values at call time. Each function is stateless, type-annotated, and importable without any internal Mimesis dependency. The pattern is directly reusable in any data-generation or serialisation pipelineβextract the file and it works immediately.
Implements a custom Random class extending Python's random.Random with additional methods for weighted choices, uniform distribution over integers, and deterministic seeding. The class is entirely self-contained (standard library only) and can be extracted and used in any project requiring reproducible, cryptographically-insecure randomness with custom selection logic.
Defines BaseProvider and BaseDataProvider abstract base classes with an automatic registry pattern (via __init_subclass__ and optional Meta attributes like name, datafile, auto_register). This design allows new providers to be created simply by subclassing and setting Meta; the registry is then discoverable by Generic. The composability and registration mechanics are architecturally clean and could be extracted (with minimal adaptation) to build a plugin-based data-generation framework.