{"library":"factory-boy","type":"library","category":null,"description":"factory-boy is a versatile test fixtures replacement for Python, based on thoughtbot's factory_bot for Ruby. It helps generate fake data efficiently and declaratively for various ORMs like Django, SQLAlchemy, and MongoEngine, supporting multiple build strategies and factory inheritance.","language":"python","status":"active","version":"3.3.3","tags":["testing","fixtures","factory","data generation","ORM","Django","SQLAlchemy"],"last_verified":"Sun Jun 28","install":[{"cmd":"pip install factory-boy","imports":["import factory\n\nclass MyFactory(factory.Factory): ...","import factory\n\nclass MyFactory(factory.Factory):\n    name = factory.Faker('name')","import factory\n\nclass MyFactory(factory.Factory):\n    id = factory.Sequence(lambda n: n)","import factory\n\nclass MyFactory(factory.Factory):\n    full_name = factory.LazyAttribute(lambda o: f'{o.first_name} {o.last_name}')","import factory\n\nclass UserFactory(factory.Factory): ...\nclass ProfileFactory(factory.Factory):\n    user = factory.SubFactory(UserFactory)","from factory.django import DjangoModelFactory\n\nclass UserFactory(DjangoModelFactory):\n    class Meta:\n        model = User","from factory.alchemy import SQLAlchemyModelFactory\n\nclass UserFactory(SQLAlchemyModelFactory):\n    class Meta:\n        model = User\n        sqlalchemy_session = db_session"]}],"homepage":"https://factoryboy.readthedocs.io","github":"https://github.com/FactoryBoy/factory_boy","docs":null,"changelog":null,"pypi":"https://pypi.org/project/factory-boy/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":2.9,"avg_import_s":0.36,"wheel_type":"wheel"},"url":"https://checklist.day/v1/registry/factory-boy/compatibility"}}