Quick start =========== Installation ------------ .. code-block:: sh pip install faker-file[all] Usage ----- With ``Faker`` ~~~~~~~~~~~~~~ **Imports and initialization** .. pytestmark: django_db .. literalinclude:: _static/examples/quick_start/import_and_init_1.py :language: python :lines: 2-78 :name: test_import_and_init_1 **Usage examples** .. pytestmark: django_db .. literalinclude:: _static/examples/quick_start/import_and_init_1.py :language: python :lines: 87-121 :name: test_import_and_init_2 If you just need bytes back (instead of creating the file), provide the ``raw=True`` argument (works with all provider classes and inner functions): .. container:: jsphinx-download .. pytestmark: django_db .. literalinclude:: _static/examples/quick_start/import_and_init_1.py :language: python :lines: 124- :name: test_import_and_init_3 *See the full example* :download:`here <_static/examples/quick_start/import_and_init_1.py>` ---- With ``factory_boy`` ~~~~~~~~~~~~~~~~~~~~ **Imports and initialization** .. pytestmark: django_db .. literalinclude:: _static/examples/quick_start/factory_import_and_init_1.py :language: python :lines: 3, 5-45, 49-78 :name: test_factory_import_and_init_1 **upload/models.py** .. container:: jsphinx-download .. pytestmark: django_db .. literalinclude:: _static/examples/quick_start/factory_models_1.py :language: python :lines: 1, 3-11 :name: test_factory_models_1 *See the full example* :download:`here <_static/examples/quick_start/factory_models_1.py>` **upload/factories.py** .. pytestmark: django_db .. literalinclude:: _static/examples/quick_start/factory_import_and_init_1.py :language: python :lines: 2-4, 46-49, 80-118 :name: test_factory_import_and_init_2 **Usage example** .. container:: jsphinx-download .. pytestmark: django_db .. literalinclude:: _static/examples/quick_start/factory_import_and_init_1.py :language: python :lines: 122- :name: test_factory_import_and_init_3 *See the full example* :download:`here <_static/examples/quick_start/factory_import_and_init_1.py>`