Registry / testing / mimesis

mimesis

JSON →
library21.0.0pypypi✓ verified 23d ago

Mimesis is a powerful and fast fake data generator for Python. It provides data for a variety of purposes, including populating databases, creating test data, and anonymizing existing datasets. As of version 19.1.0, it supports numerous locales and data types. The library maintains an active development pace, with regular minor and major releases introducing new features, locales, and performance improvements, often on a monthly or bi-monthly cadence.

pip install mimesis
INSTALL
IMPORT
SIG · MIMESIS
M
mimesis
testingpythonv21.0.0
Install
1.8s avg
Import
Disk
27MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v21.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 29.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.8s · import 0.000s · 30MB
27MB installed
● package 27MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Generic
from mimesis import Generic
Person
from mimesis import Person
Locale
from mimesis.enums import Locale
Factory
from mimesis.builtins import MimesisBaseFactory
from mimesis_factory import Factory
Since v15.0.0, mimesis-factory was integrated directly into Mimesis. Use MimesisBaseFactory or similar classes from mimesis.builtins.

This quickstart demonstrates how to initialize a `Generic` data generator with a specific locale and generate various types of fake data. It also shows direct initialization of a specific provider like `Person`.

from mimesis import Generic from mimesis.enums import Locale # Initialize with a specific locale generator = Generic(locale=Locale.EN) # Generate some fake data name = generator.person.full_name() email = generator.person.email() address = generator.address.full_address() company = generator.business.company() print(f"Name: {name}") print(f"Email: {email}") print(f"Address: {address}") print(f"Company: {company}") # Example with a specific provider person_provider = Person(Locale.RU) print(f"Russian Phone: {person_provider.phone_number()}")
Debug
Known issues
breakingThe internal pytest plugin was removed from Mimesis.
fix
Instead of relying on the internal plugin, users should create project-specific fixtures and utilize the `Field` class for data generation within their tests.
affects: >=19.0.0
breakingThe `mimesis-factory` library was integrated directly into Mimesis, changing import paths and usage patterns for factory-based data generation.
fix
If you were using `mimesis-factory`, you should now import factory-related functionalities directly from `mimesis` (e.g., `from mimesis.builtins import MimesisBaseFactory`) and adapt your code accordingly.
affects: >=15.0.0
breakingThe methods `Person.age()` and `Person.work_experience()` were removed.
fix
For generating random integers that previously `age()` or `work_experience()` might have provided, use `person.random.randint(min_value, max_value)` instead.
affects: >=13.1.0
gotchaThe `Cryptographic` provider now uses a seedable random number generator instead of Python's `secrets` module.
fix
If your previous code relied on the cryptographically secure randomness provided by `secrets` for the `Cryptographic` provider, be aware that this has changed. Ensure your usage aligns with the new seedable random behavior, especially for security-sensitive applications or when reproducible results are needed.
affects: >=19.0.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'mimesis.builtins'
Starting from Mimesis version 19.0.0, the `mimesis.builtins` module and its providers were removed, and their functionalities were either integrated into other providers or are expected to be handled by custom field handlers.
fix
If upgrading from an older version, update your code to use the standard providers directly (e.g., `Person`, `Address`). If the functionality is not directly available, implement a custom field handler. If you are using Python 3.8 or 3.9, the last compatible Mimesis version is 11.1.0.
TypeError: The provider must be a subclass of mimesis.providers.BaseProvider
When attempting to add a custom provider to a `Generic` object using `add_provider()`, the custom provider class must inherit from `mimesis.providers.BaseProvider` or `mimesis.providers.BaseDataProvider`.
fix
Ensure your custom provider class (e.g., `MyCustomProvider`) inherits from `mimesis.providers.BaseProvider`.
MimesisException: The locale 'xx' is not supported.
This error occurs when you try to initialize a provider with a locale code (represented as 'xx') that Mimesis does not currently support.
fix
Consult the Mimesis documentation for a list of all supported locales and use one of the available `Locale` enums (e.g., `Locale.EN`, `Locale.RU`) when initializing your provider.
TypeError: BaseProvider.__init__() got an unexpected keyword argument 'locale'
You are passing a `locale` argument to the constructor of a Mimesis provider that is locale-independent. These providers generate data that is universal and does not vary by language or country.
fix
Remove the `locale` argument when initializing locale-independent providers (e.g., `Code()`, `Random()`). When using `Generic()`, Mimesis automatically detects and handles locale dependencies for its sub-providers.
Upgrade
Version history
21.0.0latest on PyPI · released Jul 16, 2026
Audit
Dependencies
pythonrequiredMimesis requires Python 3.10 or newer.
Agent activity
9 hits · last 30 days
node
8
Resources
mimesis — pip install mimesis · libregistry