--- id: mixer version: "7.2.2" license: BSD license_treatment: permissive maintenance: dormant --- # mixer — Mixer -- Is a fixtures replacement. Supported Django ORM, SqlAlchemy ORM, Mongoengine ODM and custom python objects. License: permissive · Maintenance: dormant · Downloads: 270.3K/mo ## What it is and what it does Mixer is a test-data factory that automatically generates instances of ORM and ODM models with realistic fake data, eliminating the need to hand-write fixtures. It works with Django, SQLAlchemy, Flask-SQLAlchemy, Peewee, Pony, Mongoengine, and Marshmallow, and can also generate instances of plain Python classes. You initialize a mixer for your backend, then call blend() to create a model instance with auto-generated fields; you can override specific fields, control whether objects are saved to the database, and chain operations like cycle() to generate multiple instances. The package uses Faker to generate human-friendly data by default but can be configured to randomize values instead. It supports nested model generation through double-underscore syntax, field-level generators via register(), and middleware hooks to post-process generated objects. Because maintenance is dormant and the last release was in 2022, compatibility with very recent framework versions may require verification. Use it for: - Generate Django model instances with realistic data for unit and integration tests without writing verbose fixtures. - Create SQLAlchemy ORM objects on-the-fly in test suites, with automatic relationship population. - Populate test databases with bulk data using cycle() to generate multiple instances in a loop. - Override specific fields while letting Mixer auto-generate the rest, e.g. blend(User, username='admin'). - Test Mongoengine or Marshmallow schemas by generating valid instances with required fields automatically filled. - Mock nested relationships by using double-underscore syntax to set related object fields without manual creation. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Mixer generates test data and model instances for Django, SQLAlchemy, Flask-SQLAlchemy, Peewee, Pony, Mongoengine, and Marshmallow, replacing manual fixture creation with automatic fake-data generation. Yes, if you are testing Django or SQLAlchemy models and want to reduce fixture boilerplate. The package is mature (Production/Stable, 955 stars) and has no known vulnerabilities. However, verify compatibility with your specific framework versions—maintenance is dormant (last release 2022-03-23), so if you use very recent Django or SQLAlchemy releases, test thoroughly or check for open issues in the repository before committing to it. ## Install pip install mixer uv add mixer poetry add mixer ## Installing mixer Before you install: Low install friction with a single runtime dependency (Faker). Maintenance is dormant—last release was 2022-03-23 and no commits since 2024-03-08—but the package is marked Production/Stable and has accumulated 955 repository stars, suggesting it is mature and widely used despite infrequent updates. License in practice: BSD license is permissive, allowing use in commercial and open-source projects with minimal restrictions; you must include the license text in distributions. Quickstart: from mixer.backend.django import mixer user = mixer.blend('auth.user') message = mixer.blend('auth.user', username='testname') Requires Python 3.7+; Django, SQLAlchemy, or another supported ORM/ODM backend must be installed separately depending on which models you want to generate. Verify before relying: - Whether dormant maintenance (last release 2022-03-23) poses compatibility risks with recent Django/SQLAlchemy versions. - Whether the package's documented support for Django 3.0 and 3.1 extends to current Django LTS releases. - Real-world compatibility testing results with Python 3.8, 3.9, and later versions. ## Package facts - License: BSD (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 270.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django test fixtures, sqlalchemy model factory, test data generation, orm instance generator, fixture replacement, fake data for testing, model mocking, fixtures, orm-factory, test-data [View on SkillFed](https://skillfed.io/packages/mixer) · [View on PyPI](https://pypi.org/project/mixer/)