Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
A test fixtures replacement for Python
| Date | Stars |
|---|---|
| 2026-07-24 | 3805 |
| 2026-07-25 | 3805 |
| 2026-07-28 | 3805 |
| 2026-07-30 | 3805 |
| 2026-08-06 | 3805 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
factory_boy
===========
.. image:: https://github.com/FactoryBoy/factory_boy/workflows/Test/badge.svg
:target: https://github.com/FactoryBoy/factory_boy/actions?query=workflow%3ATest
.. image:: https://github.com/FactoryBoy/factory_boy/workflows/Check/badge.svg
:target: https://github.com/FactoryBoy/factory_boy/actions?query=workflow%3ACheck
.. image:: https://img.shields.io/pypi/v/factory_boy.svg
:target: https://factoryboy.readthedocs.io/en/latest/changelog.html
:alt: Latest Version
.. image:: https://img.shields.io/pypi/pyversions/factory_boy.svg
:target: https://pypi.org/project/factory-boy/
:alt: Supported Python versions
.. image:: https://img.shields.io/pypi/wheel/factory_boy.svg
:target: https://pypi.org/project/factory-boy/
:alt: Wheel status
.. image:: https://img.shields.io/pypi/l/factory_boy.svg
:target: https://github.com/FactoryBoy/factory_boy/blob/master/LICENSE
:alt: License
factory_boy is a fixtures replacement based on thoughtbot's `factory_bot <https://github.com/thoughtbot/factory_bot>`_.
As a fixtures replacement tool, it aims to replace static, hard to maintain fixtures
with easy-to-use factories for complex objects.
Instead of building an exhaustive test setup with every possible combination of corner cases,
``factory_boy`` allows you to use objects customized for the current test,
while only declaring the test-specific fields:
.. code-block:: python
class FooTests(unittest.TestCase):
def test_with_factory_boy(self):
# We need a 200€, paid order, shipping to australia, for a VIP customer
order = OrderFactory(
amount=200,
status='PAID',
customer__is_vip=True,
address__country='AU',
)
# Run the tests here
def test_without_factory_boy(self):
address = Address(
street="42 fubar street",
zipcode="42Z42",
city="Sydney",
country="AU",
)
customer = Customer(
first_name="John",
last_name="Doe",
phone="+1234",
email="[email protected]",
active=True,
is_vip=True,
address=address,
)
# etc.
factory_boy is designed to work well with various ORMs (Django, MongoDB, SQLAlchemy),
and can easily be extended for other libraries.
Its main features include:
- Straightforward declarative syntax
- Chaining factory calls while retaining the global context
- Support for multiple build strategies (saved/unsaved instances, stubbed objects)
- Multiple factories per class support, including inheritance
Links
-----
* Documentation: https://factoryboy.readthedocs.io/
* Repository: https://github.com/FactoryBoy/factory_boy
* Package: https://pypi.org/project/factory-boy/
* Mailing-list: `[email protected] <mailto:[email protected]>`_ | https://groups.google.com/forum/#!forum/factoryboy
Download
--------
PyPI: https://pypi.org/project/factory-boy/
.. code-block:: sh
$ pip install factory_boy
Source: https://github.com/FactoryBoy/factory_boy/
.. code-block:: sh
$ git clone git://github.com/FactoryBoy/factory_boy/
$ python setup.py install
Usage
-----
.. note:: This section provides a quick summary of factory_boy features.
A more detailed listing is available in the full documentation.
Defining factories
""""""""""""""""""
Factories declare a set of attributes used to instantiate a Python object.
The class of the object must be defined in the ``model`` field of a ``class Meta:`` attribute:
.. code-block:: python
import factory
from . import models
class UserFactory(factory.Factory):
class Meta:
model = models.User
first_name = 'John'
last_name = 'Doe'
admin = False
# Another, different, factory forExcerpt of 13,201 characters
Read on GitHubRaphaël Barrois · @Spacinov · France
583
154
Jon Dufresne · Pioneer Valley Books · Canada
42
Javier Buzzi · Multi Media LLC
36
16
13
Christian Clauss · Christian Clauss · Switzerland
10
7
6
6
Serhii Tereshchenko · Ukraine
5
4
Demur Nodia · pv0.one · Georgia
3
3
Mikhail Korobov · @zytedata, @ScrapingHub · Russia
3
3
3
Chris Lasher · Tiny IG Software · United States
3
Michael Joseph
2
Victorien · @pydantic · Netherlands
2
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:640e3f09e4497f03, topic:testing