anapaulagomes: Sounds good to me, @amureki. @radwon, thank you for your contribution! :tada: 
berinhard: I agree with your suggestion @amureki for the `Recipe` as well! Can you document it on a new issue?


radwon: @berinhard I've made the requested changes, and also made some changes to `test_recipes.py` renaming `self.fail` to `pytest.fail` as the `TestDefiningRecipes` class doesn't actually have a `fail` method.

Hope that's OK. Let me know if there's anything else.
berinhard: I'm merging since @anapaulagomes had already approved this previously and @radwon only added tests to make sure the changes he'd introduced are working.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 18fc8a1..ccebfea 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
 ### Added
 
 ### Changed
+- Enable `seq` to be imported from `baker` [PR #76](https://github.com/model-bakers/model_bakery/pull/76)
 
 ### Removed
 
diff --git a/docs/source/recipes.rst b/docs/source/recipes.rst
index bc13bc4..434ce76 100644
--- a/docs/source/recipes.rst
+++ b/docs/source/recipes.rst
@@ -225,20 +225,18 @@ Sometimes, you have a field with an unique value and using ``make`` can cause ra
 
 This will append a counter to strings to avoid uniqueness problems and it will sum the counter with numerical values.
 
-Sequences and iterables can be used not only for recipes, but with ``baker.make`` as well:
+Sequences and iterables can be used not only for recipes, but with ``baker`` as well:
 
 .. code-block:: python
 
 
-    # it can be imported directly from model_bakery
-    >>> from model_bakery import seq
     >>> from model_bakery import baker
 
-    >>> customer = baker.make('Customer', name=seq('Joe'))
+    >>> customer = baker.make('Customer', name=baker.seq('Joe'))
     >>> customer.name
     'Joe1'
 
-    >>> customers = baker.make('Customer', name=seq('Chad'), _quantity=3)
+    >>> customers = baker.make('Customer', name=baker.seq('Chad'), _quantity=3)
     >>> for customer in customers:
     ...     print(customer.name)
     'Chad1'
diff --git a/model_bakery/baker.py b/model_bakery/baker.py
index 7c618e6..3625f76 100644
--- a/model_bakery/baker.py
+++ b/model_bakery/baker.py
@@ -30,6 +30,9 @@ from .exceptions import (
 )
 from .utils import import_from_str
 
+# Enable seq to be imported from baker
+from .utils import seq  # NoQA
+
 recipes = None
 
 # FIXME: use pkg_resource

Enable seq to be imported from baker
I think it would be useful to also enable the seq() function to be imported from the baker module like it is in the recipe module so that it can be used as baker.seq() if preferred or to avoid namespace issues.

The current import can be left in place for backwards compatibility or to continue importing seq as before.
diff --git a/tests/test_baker.py b/tests/test_baker.py
index e8fa69c..97bffe4 100644
--- a/tests/test_baker.py
+++ b/tests/test_baker.py
@@ -20,6 +20,14 @@ from tests.generic import models
 from tests.generic.forms import DummyGenericIPAddressFieldForm
 
 
+def test_import_seq_from_baker():
+    """Test import seq method from baker module."""
+    try:
+        from model_bakery.baker import seq  # NoQA
+    except ImportError:
+        pytest.fail("{} raised".format(ImportError.__name__))
+
+
 class TestsModelFinder:
     def test_unicode_regression(self):
         obj = baker.prepare("generic.Person")
diff --git a/tests/test_recipes.py b/tests/test_recipes.py
index 7fc8fac..d4d2341 100644
--- a/tests/test_recipes.py
+++ b/tests/test_recipes.py
@@ -33,17 +33,16 @@ recipe_attrs = {
 person_recipe = Recipe(Person, **recipe_attrs)
 
 
+def test_import_seq_from_recipe():
+    """Test import seq method from recipe module."""
+    try:
+        from model_bakery.recipe import seq  # NoQA
+    except ImportError:
+        pytest.fail("{} raised".format(ImportError.__name__))
+
+
 @pytest.mark.django_db
 class TestDefiningRecipes:
-    def test_import_seq_from_baker(self):
-        """
-            Import seq method directly from baker module
-        """
-        try:
-            from model_bakery import seq  # NoQA
-        except ImportError:
-            self.fail("{} raised".format(ImportError.__name__))
-
     def test_flat_model_make_recipe_with_the_correct_attributes(self):
         """
           A 'flat model' means a model without associations, like
@@ -165,7 +164,7 @@ class TestDefiningRecipes:
         try:
             p.make(_quantity=5)
         except AttributeError as e:
-            self.fail("%s" % e)
+            pytest.fail("%s" % e)
 
 
 @pytest.mark.django_db

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-django
apt-get update apt-get install -y gcc
3.7
requirements.txt dev_requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
asgiref==3.7.2
Babel==2.14.0
black==23.3.0
bleach==6.0.0
cachetools==5.5.2
certifi @ file:///croot/certifi_1671487769961/work/certifi
cfgv==3.3.1
chardet==5.2.0
charset-normalizer==3.4.1
click==8.1.8
colorama==0.4.6
distlib==0.3.9
Django==3.2.25
docutils==0.19
exceptiongroup==1.2.2
filelock==3.12.2
identify==2.5.24
idna==3.10
imagesize==1.4.1
importlib-metadata==6.7.0
iniconfig==2.0.0
Jinja2==3.1.6
MarkupSafe==2.1.5
-e git+https://github.com/model-bakers/model_bakery.git@0256cf6607c5d8ba24576c2e0290060c1a203a88#egg=model_bakery
mypy-extensions==1.0.0
nodeenv==1.9.1
packaging==24.0
pathspec==0.11.2
Pillow==9.5.0
pkginfo==1.10.0
platformdirs==4.0.0
pluggy==1.2.0
pre-commit==2.21.0
Pygments==2.17.2
pyproject-api==1.5.3
pytest==7.4.4
pytest-django==4.5.2
pytz==2025.2
PyYAML==6.0.1
readme-renderer==37.3
requests==2.31.0
requests-toolbelt==1.0.0
six==1.17.0
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
sqlparse==0.4.4
tomli==2.0.1
tox==4.8.0
tqdm==4.67.1
twine==2.0.0
typed-ast==1.5.5
typing_extensions==4.7.1
urllib3==2.0.7
virtualenv==20.26.6
webencodings==0.5.1
zipp==3.15.0

name: model_bakery
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - asgiref==3.7.2
      - babel==2.14.0
      - black==23.3.0
      - bleach==6.0.0
      - cachetools==5.5.2
      - cfgv==3.3.1
      - chardet==5.2.0
      - charset-normalizer==3.4.1
      - click==8.1.8
      - colorama==0.4.6
      - distlib==0.3.9
      - django==3.2.25
      - docutils==0.19
      - exceptiongroup==1.2.2
      - filelock==3.12.2
      - identify==2.5.24
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - jinja2==3.1.6
      - markupsafe==2.1.5
      - mypy-extensions==1.0.0
      - nodeenv==1.9.1
      - packaging==24.0
      - pathspec==0.11.2
      - pillow==9.5.0
      - pkginfo==1.10.0
      - platformdirs==4.0.0
      - pluggy==1.2.0
      - pre-commit==2.21.0
      - pygments==2.17.2
      - pyproject-api==1.5.3
      - pytest==7.4.4
      - pytest-django==4.5.2
      - pytz==2025.2
      - pyyaml==6.0.1
      - readme-renderer==37.3
      - requests==2.31.0
      - requests-toolbelt==1.0.0
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - sqlparse==0.4.4
      - tomli==2.0.1
      - tox==4.8.0
      - tqdm==4.67.1
      - twine==2.0.0
      - typed-ast==1.5.5
      - typing-extensions==4.7.1
      - urllib3==2.0.7
      - virtualenv==20.26.6
      - webencodings==0.5.1
      - zipp==3.15.0
prefix: /opt/conda/envs/model_bakery

tests/test_baker.py::test_import_seq_from_baker
tests/test_baker.py::TestsBakerCreatesSimpleModel::test_consider_real_django_fields_only tests/test_baker.py::TestsBakerCreatesSimpleModel::test_make_should_create_one_object tests/test_baker.py::TestsBakerCreatesSimpleModel::test_prepare_should_not_persist_one_object tests/test_baker.py::TestsBakerCreatesSimpleModel::test_non_abstract_model_creation tests/test_baker.py::TestsBakerCreatesSimpleModel::test_abstract_model_subclass_creation tests/test_baker.py::TestsBakerCreatesSimpleModel::test_multiple_inheritance_creation tests/test_baker.py::TestsBakerRepeatedCreatesSimpleModel::test_make_should_create_objects_respecting_quantity_parameter tests/test_baker.py::TestsBakerRepeatedCreatesSimpleModel::test_make_raises_correct_exception_if_invalid_quantity tests/test_baker.py::TestsBakerRepeatedCreatesSimpleModel::test_prepare_should_create_objects_respecting_quantity_parameter tests/test_baker.py::TestsBakerRepeatedCreatesSimpleModel::test_prepare_raises_correct_exception_if_invalid_quantity tests/test_baker.py::TestsBakerRepeatedCreatesSimpleModel::test_accepts_generators_with_quantity tests/test_baker.py::TestsBakerRepeatedCreatesSimpleModel::test_accepts_generators_with_quantity_for_unique_fields tests/test_baker.py::TestsBakerRepeatedCreatesSimpleModel::test_generators_work_with_user_model tests/test_baker.py::TestBakerPrepareSavingRelatedInstances::test_default_behaviour_for_and_fk tests/test_baker.py::TestBakerPrepareSavingRelatedInstances::test_create_fk_instances tests/test_baker.py::TestBakerPrepareSavingRelatedInstances::test_create_fk_instances_with_quantity tests/test_baker.py::TestBakerPrepareSavingRelatedInstances::test_create_one_to_one tests/test_baker.py::TestBakerCreatesAssociatedModels::test_dependent_models_with_ForeignKey tests/test_baker.py::TestBakerCreatesAssociatedModels::test_foreign_key_on_parent_should_create_one_object tests/test_baker.py::TestBakerCreatesAssociatedModels::test_foreign_key_on_parent_is_not_created tests/test_baker.py::TestBakerCreatesAssociatedModels::test_foreign_key_on_parent_id_is_not_created tests/test_baker.py::TestBakerCreatesAssociatedModels::test_auto_now_add_on_parent_should_work tests/test_baker.py::TestBakerCreatesAssociatedModels::test_attrs_on_related_model_through_parent tests/test_baker.py::TestBakerCreatesAssociatedModels::test_access_related_name_of_m2m tests/test_baker.py::TestBakerCreatesAssociatedModels::test_save_object_instances_when_handling_one_to_many_relations tests/test_baker.py::TestBakerCreatesAssociatedModels::test_prepare_fk tests/test_baker.py::TestBakerCreatesAssociatedModels::test_create_one_to_one tests/test_baker.py::TestBakerCreatesAssociatedModels::test_create_many_to_many_if_flagged tests/test_baker.py::TestBakerCreatesAssociatedModels::test_regresstion_many_to_many_field_is_accepted_as_kwargs tests/test_baker.py::TestBakerCreatesAssociatedModels::test_create_many_to_many_with_set_default_quantity tests/test_baker.py::TestBakerCreatesAssociatedModels::test_create_many_to_many_with_through_option tests/test_baker.py::TestBakerCreatesAssociatedModels::test_does_not_create_many_to_many_as_default tests/test_baker.py::TestBakerCreatesAssociatedModels::test_does_not_create_nullable_many_to_many_for_relations tests/test_baker.py::TestBakerCreatesAssociatedModels::test_nullable_many_to_many_is_not_created_even_if_flagged tests/test_baker.py::TestBakerCreatesAssociatedModels::test_m2m_changed_signal_is_fired tests/test_baker.py::TestBakerCreatesAssociatedModels::test_simple_creating_person_with_parameters tests/test_baker.py::TestBakerCreatesAssociatedModels::test_creating_person_from_factory_using_paramters tests/test_baker.py::TestBakerCreatesAssociatedModels::test_ForeignKey_model_field_population tests/test_baker.py::TestBakerCreatesAssociatedModels::test_ForeignKey_model_field_population_should_work_with_prepare tests/test_baker.py::TestBakerCreatesAssociatedModels::test_ForeignKey_model_field_population_for_not_required_fk tests/test_baker.py::TestBakerCreatesAssociatedModels::test_does_not_creates_null_ForeignKey tests/test_baker.py::TestBakerCreatesAssociatedModels::test_passing_m2m_value tests/test_baker.py::TestBakerCreatesAssociatedModels::test_ensure_recursive_ForeignKey_population tests/test_baker.py::TestBakerCreatesAssociatedModels::test_field_lookup_for_m2m_relationship tests/test_baker.py::TestBakerCreatesAssociatedModels::test_field_lookup_for_one_to_one_relationship tests/test_baker.py::TestBakerCreatesAssociatedModels::test_allow_create_fkey_related_model tests/test_baker.py::TestBakerCreatesAssociatedModels::test_field_lookup_for_related_field tests/test_baker.py::TestBakerCreatesAssociatedModels::test_field_lookup_for_related_field_does_not_work_with_prepare tests/test_baker.py::TestHandlingUnsupportedModels::test_unsupported_model_raises_an_explanatory_exception tests/test_baker.py::TestHandlingModelsWithGenericRelationFields::test_create_model_with_generic_relation tests/test_baker.py::TestHandlingContentTypeField::test_create_model_with_contenttype_field tests/test_baker.py::TestHandlingContentTypeFieldNoQueries::test_create_model_with_contenttype_field tests/test_baker.py::TestSkipNullsTestCase::test_skip_null tests/test_baker.py::TestFillNullsTestCase::test_create_nullable_many_to_many_if_flagged_and_fill_field_optional tests/test_baker.py::TestFillNullsTestCase::test_create_nullable_many_to_many_if_flagged_and_fill_optional tests/test_baker.py::TestFillNullsTestCase::test_nullable_many_to_many_is_not_created_if_not_flagged_and_fill_optional tests/test_baker.py::TestSkipBlanksTestCase::test_skip_blank tests/test_baker.py::TestFillBlanksTestCase::test_fill_field_optional tests/test_baker.py::TestFillBlanksTestCase::test_fill_wrong_field tests/test_baker.py::TestFillBlanksTestCase::test_fill_wrong_fields_with_parent tests/test_baker.py::TestFillBlanksTestCase::test_fill_many_optional tests/test_baker.py::TestFillBlanksTestCase::test_fill_all_optional tests/test_baker.py::TestFillBlanksTestCase::test_fill_optional_with_integer tests/test_baker.py::TestFillAutoFieldsTestCase::test_fill_autofields_with_provided_value tests/test_baker.py::TestFillAutoFieldsTestCase::test_keeps_prepare_autovalues tests/test_baker.py::TestSkipDefaultsTestCase::test_skip_fields_with_default tests/test_baker.py::TestBakerHandlesModelWithNext::test_creates_instance_for_model_with_next tests/test_baker.py::TestBakerHandlesModelWithList::test_creates_instance_for_model_with_list tests/test_baker.py::TestBakerGeneratesIPAdresses::test_create_model_with_valid_ips tests/test_baker.py::TestBakerAllowsSaveParameters::test_allows_save_kwargs_on_baker_make tests/test_baker.py::TestBakerAutomaticallyRefreshFromDB::test_refresh_from_db_if_true tests/test_baker.py::TestBakerAutomaticallyRefreshFromDB::test_do_not_refresh_from_db_if_false tests/test_baker.py::TestBakerAutomaticallyRefreshFromDB::test_do_not_refresh_from_db_by_default tests/test_baker.py::TestBakerMakeCanFetchInstanceFromDefaultManager::test_annotation_within_manager_get_queryset_are_run_on_make tests/test_recipes.py::TestDefiningRecipes::test_flat_model_make_recipe_with_the_correct_attributes tests/test_recipes.py::TestDefiningRecipes::test_flat_model_prepare_recipe_with_the_correct_attributes tests/test_recipes.py::TestDefiningRecipes::test_accepts_callable tests/test_recipes.py::TestDefiningRecipes::test_always_calls_when_creating tests/test_recipes.py::TestDefiningRecipes::test_always_calls_with_quantity tests/test_recipes.py::TestDefiningRecipes::test_make_recipes_with_args tests/test_recipes.py::TestDefiningRecipes::test_prepare_recipes_with_args tests/test_recipes.py::TestDefiningRecipes::test_make_recipe_without_all_model_needed_data tests/test_recipes.py::TestDefiningRecipes::test_prepare_recipe_without_all_model_needed_data tests/test_recipes.py::TestDefiningRecipes::test_defining_recipes_str tests/test_recipes.py::TestExecutingRecipes::test_model_with_foreign_key tests/test_recipes.py::TestExecutingRecipes::test_model_with_foreign_key_as_str tests/test_recipes.py::TestExecutingRecipes::test_model_with_foreign_key_as_unicode tests/test_recipes.py::TestExecutingRecipes::test_make_recipe tests/test_recipes.py::TestExecutingRecipes::test_make_recipe_with_quantity_parameter tests/test_recipes.py::TestExecutingRecipes::test_make_extended_recipe tests/test_recipes.py::TestExecutingRecipes::test_extended_recipe_type tests/test_recipes.py::TestExecutingRecipes::test_save_related_instances_on_prepare_recipe tests/test_recipes.py::TestExecutingRecipes::test_make_recipe_with_quantity_parameter_respection_model_args tests/test_recipes.py::TestExecutingRecipes::test_make_recipe_raises_correct_exception_if_invalid_quantity tests/test_recipes.py::TestExecutingRecipes::test_prepare_recipe_with_foreign_key tests/test_recipes.py::TestExecutingRecipes::test_prepare_recipe_with_quantity_parameter tests/test_recipes.py::TestExecutingRecipes::test_prepare_recipe_with_quantity_parameter_respection_model_args tests/test_recipes.py::TestExecutingRecipes::test_prepare_recipe_raises_correct_exception_if_invalid_quantity tests/test_recipes.py::TestExecutingRecipes::test_prepare_recipe tests/test_recipes.py::TestExecutingRecipes::test_make_recipe_with_args tests/test_recipes.py::TestExecutingRecipes::test_prepare_recipe_with_args tests/test_recipes.py::TestExecutingRecipes::test_import_recipe_inside_deeper_modules tests/test_recipes.py::TestExecutingRecipes::test_pass_save_kwargs tests/test_recipes.py::TestExecutingRecipes::test_ip_fields_with_start tests/test_recipes.py::TestForeignKey::test_foreign_key_method_returns_a_recipe_foreign_key_object tests/test_recipes.py::TestForeignKey::test_not_accept_other_type tests/test_recipes.py::TestForeignKey::test_do_not_create_related_model tests/test_recipes.py::TestForeignKey::test_do_query_lookup_for_recipes_make_method tests/test_recipes.py::TestForeignKey::test_do_query_lookup_for_recipes_prepare_method tests/test_recipes.py::TestForeignKey::test_do_query_lookup_empty_recipes tests/test_recipes.py::TestForeignKey::test_related_models_recipes tests/test_recipes.py::TestForeignKey::test_nullable_related tests/test_recipes.py::TestForeignKey::test_chained_related tests/test_recipes.py::TestM2MField::test_create_many_to_many tests/test_recipes.py::TestM2MField::test_create_nested tests/test_recipes.py::TestSequences::test_increment_for_strings tests/test_recipes.py::TestSequences::test_increment_for_numbers tests/test_recipes.py::TestSequences::test_increment_for_numbers_2 tests/test_recipes.py::TestSequences::test_creates_unique_field_recipe_using_for_iterator tests/test_recipes.py::TestSequences::test_creates_unique_field_recipe_using_quantity_argument tests/test_recipes.py::TestSequences::test_increment_by_3 tests/test_recipes.py::TestSequences::test_increment_by_timedelta tests/test_recipes.py::TestSequences::test_creates_unique_timedelta_recipe_using_quantity_argument tests/test_recipes.py::TestSequences::test_increment_after_override_definition_field tests/test_recipes.py::TestIterators::test_accepts_generators tests/test_recipes.py::TestIterators::test_accepts_iterators tests/test_recipes.py::TestIterators::test_empty_iterator_exception tests/test_recipes.py::TestIterators::test_only_iterators_not_iteratables_are_iterated tests/test_baker.py::TestsModelFinder::test_unicode_regression tests/test_baker.py::TestsModelFinder::test_model_class tests/test_baker.py::TestsModelFinder::test_app_model_string tests/test_baker.py::TestsModelFinder::test_model_string tests/test_baker.py::TestsModelFinder::test_raise_on_ambiguous_model_string tests/test_baker.py::TestsModelFinder::test_raise_model_not_found tests/test_recipes.py::test_import_seq_from_recipe
docs/source/recipes.rst model_bakery/baker.py CHANGELOG.md
docs/source/recipes.rst model_bakery/baker.py CHANGELOG.md