Mixer

Object generation tool for testing across Django SQLAlchemy and other Python ORMs

What it is

Mixer is an open source object generation library designed to simplify test data creation for Python applications. It provides a unified interface for generating model instances across multiple popular ORMs and ODMs including Django ORM SQLAlchemy Pony ORM Peewee and Mongoengine. The tool eliminates the need for manual fixture creation by automatically populating fields with random or fake values while respecting model constraints and relationships.

The library offers several powerful features for test automation. Developers can force specific values override random generation select existing relations from the database and create virtual mixed objects that combine real and generated data. Flask integration is documented alongside the core ORM adapters making it straightforward to incorporate into existing web applications. The API reference details every class method and configuration option for precise control over data generation.

Python developers who write unit tests integration tests or need realistic sample data for development environments will find Mixer particularly valuable. It reduces boilerplate fixture code accelerates test suite creation and helps maintain test isolation by generating fresh data for each test case. Teams working with multiple ORMs across projects benefit from a consistent data generation approach rather than learning separate fixture tools for each framework.

Getting started requires installing the package via pip then following the quickstart guide which demonstrates basic usage patterns. The documentation is organized by ORM with dedicated sections for Django SQLAlchemy Flask and Mongoengine. Each section includes installation steps model binding examples and advanced configuration. The project is hosted on GitHub where the issue tracker accepts bug reports and feature requests.

Mixer stands out for its broad ORM support permissive BSD license and comprehensive documentation hosted on Read the Docs. Active development continues on GitHub with versioned releases available for download in PDF HTML and EPUB formats. The tool fills a specific niche in the Python testing ecosystem by providing a single dependency that handles test data generation across diverse data layers.

This description was generated by AI from the site's public content and may contain errors.

What you can do there

  • Read documentation for multiple ORM integrations
  • Access API reference for classes and methods
  • View installation and quickstart guides
  • Report issues on GitHub
  • Download documentation in PDF HTML EPUB

Who it's for

Python developers writing tests who need automated test data generation across ORMs

Frequently asked questions about mixer.readthedocs.io

›What ORMs does Mixer support

Mixer supports Django ORM SQLAlchemy Pony ORM Peewee ORM and Mongoengine ODM with documented Flask integration

›How do I install Mixer

Install Mixer using pip install mixer then follow the quickstart guide in the documentation for your specific ORM

›Can Mixer generate fake data for testing

Yes Mixer can force fake values using providers like Faker and also supports random value generation for all field types

›Is Mixer compatible with Django

Django ORM is a primary supported framework with a dedicated documentation section covering model binding and Django specific features

›Where can I report bugs or request features

Bug reports and feature requests should be submitted to the GitHub issue tracker at github.com/klen/mixer/issues

›Does Mixer work with MongoDB

Yes Mongoengine ODM is supported allowing document generation for MongoDB databases

›Is Mixer free to use

Mixer is released under the BSD license making it free for both personal and commercial use