nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: joke2k/faker
Pull request #1634 (2022-04-19 20:57:32)

feat: :globe_with_meridians: add it_IT automotive provider
Adding the ability to provide fake plates (automotive provider) for it_IT locale.

Refers to issue #1633.

Hope it can help. 

Thank you.


Patch:
diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index 0dba648a..010f9c82 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 13.3.4
+current_version = 13.3.5
 files = VERSION faker/__init__.py docs/conf.py
 commit = True
 tag = True
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9154a061..46ba3657 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
 ## Changelog
 
+### [v13.3.5 - 2022-04-20](https://github.com/joke2k/faker/compare/v13.3.4...v13.3.5)
+
+* Fix error in currency provider data. Thanks @zerogonal.
+
 ### [v13.3.4 - 2022-03-28](https://github.com/joke2k/faker/compare/v13.3.3...v13.3.4)
 
 * Bump actions/cache from 2 to 3 (#1631). Thanks @dependabot[bot].
diff --git a/VERSION b/VERSION
index 51d9561a..51a2b1d4 100644
--- a/VERSION
+++ b/VERSION
@@ -1,1 +1,1 @@
-13.3.4
+13.3.5
diff --git a/docs/conf.py b/docs/conf.py
index c4ed8e8a..db5b5460 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -51,9 +51,9 @@ copyright = "2014, Daniele Faraglia"
 # built documents.
 #
 # The short X.Y version.
-version = "13.3.4"
+version = "13.3.5"
 # The full version, including alpha/beta/rc tags.
-release = "13.3.4"
+release = "13.3.5"
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff --git a/faker/__init__.py b/faker/__init__.py
index 81935b16..88964e67 100644
--- a/faker/__init__.py
+++ b/faker/__init__.py
@@ -2,6 +2,6 @@ from faker.factory import Factory
 from faker.generator import Generator
 from faker.proxy import Faker
 
-VERSION = "13.3.4"
+VERSION = "13.3.5"
 
 __all__ = ("Factory", "Generator", "Faker")
diff --git a/faker/providers/automotive/it_IT/__init__.py b/faker/providers/automotive/it_IT/__init__.py
new file mode 100644
index 00000000..c1545345
--- /dev/null
+++ b/faker/providers/automotive/it_IT/__init__.py
@@ -0,0 +1,15 @@
+from .. import Provider as AutomotiveProvider
+
+
+class Provider(AutomotiveProvider):
+    """Implement automotive provider for ``it_IT`` locale.
+
+    Sources:
+
+    - https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_Italy
+    """
+
+    license_formats = (
+        # 1994-present
+        "??###??",
+    )


Test patch:
diff --git a/tests/providers/test_automotive.py b/tests/providers/test_automotive.py
index 1570c05f..ded4ebf7 100644
--- a/tests/providers/test_automotive.py
+++ b/tests/providers/test_automotive.py
@@ -154,6 +154,12 @@ class TestFrFr(_SimpleAutomotiveTestMixin):
     license_plate_pattern: Pattern = re.compile(r"\d{3}-[A-Z]{3}-\d{2}|[A-Z]{2}-\d{3}-[A-Z]{2}")
 
 
+class TestItIt(_SimpleAutomotiveTestMixin):
+    """Test it_IT automotive provider methods"""
+
+    license_plate_pattern: Pattern = re.compile(r"[A-Z]{2}\d{3}[A-Z]{2}")
+
+
 class TestNoNo(_SimpleAutomotiveTestMixin):
     """Test no_NO automotive provider methods"""
Repository: joke2k/faker
Pull request #1638 (2022-04-27 00:46:27)

Add ar_BH automotive provider
Added ar_BH automotive provider.


Patch:
diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index cb6e9af7..f63abff9 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 13.4.0
+current_version = 13.5.0
 files = VERSION faker/__init__.py docs/conf.py
 commit = True
 tag = True
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 217eb3f2..77cf55b6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
 ## Changelog
 
+### [v13.5.0 - 2022-04-27](https://github.com/joke2k/faker/compare/v13.4.0...v13.5.0)
+
+* Add mexican CLABE bank code for `es_MX` locale. Thanks @edgarrmondragon.
+
 ### [v13.4.0 - 2022-04-22](https://github.com/joke2k/faker/compare/v13.3.5...v13.4.0)
 
 * Add `it_IT` automotive provider. Thanks @Giorgionocera.
diff --git a/VERSION b/VERSION
index 74302c51..d224e690 100644
--- a/VERSION
+++ b/VERSION
@@ -1,1 +1,1 @@
-13.4.0
+13.5.0
diff --git a/docs/conf.py b/docs/conf.py
index 35e6d23d..3276292c 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -51,9 +51,9 @@ copyright = "2014, Daniele Faraglia"
 # built documents.
 #
 # The short X.Y version.
-version = "13.4.0"
+version = "13.5.0"
 # The full version, including alpha/beta/rc tags.
-release = "13.4.0"
+release = "13.5.0"
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff --git a/faker/__init__.py b/faker/__init__.py
index 488386ef..dd9f40ca 100644
--- a/faker/__init__.py
+++ b/faker/__init__.py
@@ -2,6 +2,6 @@ from faker.factory import Factory
 from faker.generator import Generator
 from faker.proxy import Faker
 
-VERSION = "13.4.0"
+VERSION = "13.5.0"
 
 __all__ = ("Factory", "Generator", "Faker")
diff --git a/faker/providers/automotive/ar_BH/__init__.py b/faker/providers/automotive/ar_BH/__init__.py
new file mode 100644
index 00000000..672b941d
--- /dev/null
+++ b/faker/providers/automotive/ar_BH/__init__.py
@@ -0,0 +1,12 @@
+from .. import Provider as AutomotiveProvider
+
+
+class Provider(AutomotiveProvider):
+    """Implement automotive provider for ``ar_BH`` locale.
+
+    Source:
+
+    - https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_Bahrain
+    """
+
+    license_formats = ("######",)


Test patch:
diff --git a/tests/providers/test_automotive.py b/tests/providers/test_automotive.py
index ded4ebf7..98a9e006 100644
--- a/tests/providers/test_automotive.py
+++ b/tests/providers/test_automotive.py
@@ -280,3 +280,9 @@ class TestNlNl(_SimpleAutomotiveTestMixin):
             plate = faker.license_plate_motorbike()
             assert isinstance(plate, str)
             assert self.license_plate_motorbike_pattern.match(plate)
+
+
+class TestArBh(_SimpleAutomotiveTestMixin):
+    """Test ar_BH automotive provider methods"""
+
+    license_plate_pattern: Pattern = re.compile(r"\d{6}")
Repository: joke2k/faker
Pull request #1640 (2022-04-27 22:30:23)

Add lt-LT automotive provider
Added automotive provider for lt_LT locale.


Patch:
diff --git a/faker/providers/automotive/lt_LT/__init__.py b/faker/providers/automotive/lt_LT/__init__.py
new file mode 100644
index 00000000..6e10f8d1
--- /dev/null
+++ b/faker/providers/automotive/lt_LT/__init__.py
@@ -0,0 +1,12 @@
+from .. import Provider as AutomotiveProvider
+
+
+class Provider(AutomotiveProvider):
+    """Implement automotive provider for ``lt_LT`` locale.
+
+    Source:
+
+    - https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_Lithuania
+    """
+
+    license_formats = ("??? ###",)


Test patch:
diff --git a/tests/providers/test_automotive.py b/tests/providers/test_automotive.py
index 3097a674..b39febc1 100644
--- a/tests/providers/test_automotive.py
+++ b/tests/providers/test_automotive.py
@@ -292,3 +292,9 @@ class TestViVn(_SimpleAutomotiveTestMixin):
     """Test vi_VN automotive provider methods"""
 
     license_plate_pattern: Pattern = re.compile(r"\d{2}[ABCDĐEFGHKLMNPSTUVXYZ]-\d{5}")
+
+
+class TestLtLt(_SimpleAutomotiveTestMixin):
+    """Test lt_LT automotive provider methods"""
+
+    license_plate_pattern: Pattern = re.compile(r"[A-Z]{3} \d{3}")
Repository: joke2k/faker
Pull request #1641 (2022-04-28 01:16:18)

Add et-EE automotive provider
Added automotive provider for et-EE locale.


Patch:
diff --git a/faker/providers/automotive/et_EE/__init__.py b/faker/providers/automotive/et_EE/__init__.py
new file mode 100644
index 00000000..dab55164
--- /dev/null
+++ b/faker/providers/automotive/et_EE/__init__.py
@@ -0,0 +1,12 @@
+from .. import Provider as AutomotiveProvider
+
+
+class Provider(AutomotiveProvider):
+    """Implement automotive provider for ``et_EE`` locale.
+
+    Source:
+
+    - https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_Estonia
+    """
+
+    license_formats = ("### ???",)


Test patch:
diff --git a/tests/providers/test_automotive.py b/tests/providers/test_automotive.py
index b39febc1..2c9c3373 100644
--- a/tests/providers/test_automotive.py
+++ b/tests/providers/test_automotive.py
@@ -298,3 +298,9 @@ class TestLtLt(_SimpleAutomotiveTestMixin):
     """Test lt_LT automotive provider methods"""
 
     license_plate_pattern: Pattern = re.compile(r"[A-Z]{3} \d{3}")
+
+
+class TestEtEe(_SimpleAutomotiveTestMixin):
+    """Test et_EE automotive provider methods"""
+
+    license_plate_pattern: Pattern = re.compile(r"\d{3} [A-Z]{3}")
Repository: joke2k/faker
Pull request #1642 (2022-04-28 03:02:24)

Add fi-FI automotive provider
Added automotive provider for fi_FI locale.


Patch:
diff --git a/faker/providers/automotive/fi_FI/__init__.py b/faker/providers/automotive/fi_FI/__init__.py
new file mode 100644
index 00000000..aa9420bf
--- /dev/null
+++ b/faker/providers/automotive/fi_FI/__init__.py
@@ -0,0 +1,12 @@
+from .. import Provider as AutomotiveProvider
+
+
+class Provider(AutomotiveProvider):
+    """Implement automotive provider for ``fi_FI`` locale.
+
+    Source:
+
+    - https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_Finland
+    """
+
+    license_formats = ("???-###",)


Test patch:
diff --git a/tests/providers/test_automotive.py b/tests/providers/test_automotive.py
index 2c9c3373..fc55ba2e 100644
--- a/tests/providers/test_automotive.py
+++ b/tests/providers/test_automotive.py
@@ -294,13 +294,7 @@ class TestViVn(_SimpleAutomotiveTestMixin):
     license_plate_pattern: Pattern = re.compile(r"\d{2}[ABCDĐEFGHKLMNPSTUVXYZ]-\d{5}")
 
 
-class TestLtLt(_SimpleAutomotiveTestMixin):
-    """Test lt_LT automotive provider methods"""
+class TestFiFi(_SimpleAutomotiveTestMixin):
+    """Test fi_FI automotive provider methods"""
 
-    license_plate_pattern: Pattern = re.compile(r"[A-Z]{3} \d{3}")
-
-
-class TestEtEe(_SimpleAutomotiveTestMixin):
-    """Test et_EE automotive provider methods"""
-
-    license_plate_pattern: Pattern = re.compile(r"\d{3} [A-Z]{3}")
+    license_plate_pattern: Pattern = re.compile(r"[A-Z]{3}-\d{3}")
Repository: joke2k/faker
Pull request #1644 (2022-04-28 05:03:05)

Add no-NO datetime provider
Added datetime provider for no_NO locale.

zerogonal: @fcurella I suggest that you put all of my pull requests up to this point into one big version bump.
fcurella: @zerogonal the file [faker/providers/date_time/no_NO/__init__.py](https://github.com/joke2k/faker/pull/1644/commits/e25145780a01b424fb25d377e5fd1478ec0e941b#diff-65b5a5d677b547f7f2346d93ceb306174bbedc7b3582fd2c731a63a0d6b3e02f) appears to be empty
zerogonal: oops....one second
zerogonal: @fcurella done

Patch:
diff --git a/faker/providers/date_time/no_NO/__init__.py b/faker/providers/date_time/no_NO/__init__.py
new file mode 100644
index 00000000..ac367ee6
--- /dev/null
+++ b/faker/providers/date_time/no_NO/__init__.py
@@ -0,0 +1,35 @@
+from .. import Provider as DateTimeProvider
+
+
+class Provider(DateTimeProvider):
+    MONTH_NAMES = {
+        "01": "januar",
+        "02": "februar",
+        "03": "mars",
+        "04": "april",
+        "05": "mai",
+        "06": "juni",
+        "07": "juli",
+        "08": "august",
+        "09": "september",
+        "10": "oktober",
+        "11": "november",
+        "12": "desember",
+    }
+    DAY_NAMES = {
+        "0": "søndag",
+        "1": "mandag",
+        "2": "tirsdag",
+        "3": "onsdag",
+        "4": "torsdag",
+        "5": "fredag",
+        "6": "lørdag",
+    }
+
+    def day_of_week(self) -> str:
+        day = self.date("%w")
+        return self.DAY_NAMES[day]
+
+    def month_name(self) -> str:
+        month = self.month()
+        return self.MONTH_NAMES[month]


Test patch:
diff --git a/tests/providers/test_date_time.py b/tests/providers/test_date_time.py
index 21b6e5e1..0d67b083 100644
--- a/tests/providers/test_date_time.py
+++ b/tests/providers/test_date_time.py
@@ -28,6 +28,7 @@ from faker.providers.date_time.es_ES import Provider as EsEsProvider
 from faker.providers.date_time.hy_AM import Provider as HyAmProvider
 from faker.providers.date_time.it_IT import Provider as ItItProvider
 from faker.providers.date_time.nl_NL import Provider as NlProvider
+from faker.providers.date_time.no_NO import Provider as NoNoProvider
 from faker.providers.date_time.pl_PL import Provider as PlProvider
 from faker.providers.date_time.pt_BR import Provider as PtBrProvider
 from faker.providers.date_time.pt_PT import Provider as PtPtProvider
@@ -1166,3 +1167,17 @@ class TestZhCn(unittest.TestCase):
     def test_month(self):
         day = self.fake.month_name()
         assert day in ZhCnProvider.MONTH_NAMES.values()
+
+
+class TestNoNo(unittest.TestCase):
+    def setUp(self):
+        self.fake = Faker("no-NO")
+        Faker.seed(0)
+
+    def test_day(self):
+        day = self.fake.day_of_week()
+        assert day in NoNoProvider.DAY_NAMES.values()
+
+    def test_month(self):
+        month = self.fake.month_name()
+        assert month in NoNoProvider.MONTH_NAMES.values()
Repository: joke2k/faker
Pull request #1663 (2022-05-21 14:59:40)

Add support for generating relative file paths
### What does this change

Add support for generating relative file paths to the file provider.

### What was wrong

`file_path()` would always return an absolute file path, i.e., one that starts with `/`.

### How this fixes it

The argument `absolute=True` is added to `file_path()`. It's `True` by default to not change the current behavior but can be set to `False` in case the user wants a relative path.


Patch:
diff --git a/faker/providers/file/__init__.py b/faker/providers/file/__init__.py
index 474e0423..fc8a797e 100644
--- a/faker/providers/file/__init__.py
+++ b/faker/providers/file/__init__.py
@@ -258,13 +258,17 @@ class Provider(BaseProvider):
         depth: int = 1,
         category: Optional[str] = None,
         extension: Optional[str] = None,
+        absolute: Optional[bool] = True,
     ) -> str:
-        """Generate an absolute pathname to a file.
+        """Generate an pathname to a file.
 
         This method uses |file_name| under the hood to generate the file name
         itself, and ``depth`` controls the depth of the directory path, and
         |word| is used under the hood to generate the different directory names.
 
+        If ``absolute`` is ``True`` (default), the generated path starts with
+        ``/`` and is absolute. Otherwise, the generated path is relative.
+
         :sample: size=10
         :sample: depth=3
         :sample: depth=5, category='video'
@@ -274,7 +278,7 @@ class Provider(BaseProvider):
         path: str = f"/{file}"
         for _ in range(0, depth):
             path = f"/{self.generator.word()}{path}"
-        return path
+        return path if absolute else path[1:]
 
     def unix_device(self, prefix: Optional[str] = None) -> str:
         """Generate a Unix device file name.


Test patch:
diff --git a/tests/providers/test_file.py b/tests/providers/test_file.py
index 88625326..bc46350a 100644
--- a/tests/providers/test_file.py
+++ b/tests/providers/test_file.py
@@ -15,6 +15,8 @@ class TestFile(unittest.TestCase):
         for _ in range(100):
             file_path = self.fake.file_path()
             assert re.search(r"\/\w+\/\w+\.\w+", file_path)
+            file_path = self.fake.file_path(absolute=False)
+            assert re.search(r"\w+\/\w+\.\w+", file_path)
             file_path = self.fake.file_path(depth=3)
             assert re.search(r"\/\w+\/\w+\/\w+\.\w+", file_path)
             file_path = self.fake.file_path(extension="pdf")
Repository: joke2k/faker
Pull request #1682 (2022-07-14 16:02:42)

fix: change format fake license_plate local_PT
### What does this change

In 2017, Brazil joined Mercosul economic block, where vehicle license plates followed the standard among the bloc's member countries. As a result, a new board reconfiguration was adopted.

### What was wrong

As of old format, it had "LLL - NNNN" configuration plate. With the new change, the fifth element of the plate becomes a number. Ex: "LLL-NLNN".

### How this fixes it

The change basically when creating a new fake plate, the fifth element becomes a letter. Ex: "LLL-NLNN".

Fixes #...



Patch:
diff --git a/faker/providers/automotive/pt_BR/__init__.py b/faker/providers/automotive/pt_BR/__init__.py
index a28b39f7..c844620d 100644
--- a/faker/providers/automotive/pt_BR/__init__.py
+++ b/faker/providers/automotive/pt_BR/__init__.py
@@ -4,4 +4,4 @@ from .. import Provider as AutomotiveProvider
 class Provider(AutomotiveProvider):
     """Implement automotive provider for ``pt_BR`` locale."""
 
-    license_formats = ("???-####",)
+    license_formats = ("???-#?##",)
diff --git a/setup.py b/setup.py
index 766563b7..62809a10 100644
--- a/setup.py
+++ b/setup.py
@@ -56,6 +56,12 @@ setup(
     author="joke2k",
     author_email="joke2k@gmail.com",
     url="https://github.com/joke2k/faker",
+    project_urls={
+        "Bug Tracker": "https://github.com/joke2k/faker/issues",
+        "Changes": "https://github.com/joke2k/faker/blob/master/CHANGELOG.md",
+        "Documentation": "http://faker.rtfd.org/",
+        "Source Code": "https://github.com/joke2k/faker",
+    },
     license="MIT License",
     packages=find_packages(exclude=excluded_packages),
     package_data={


Test patch:
diff --git a/tests/providers/test_automotive.py b/tests/providers/test_automotive.py
index b9863935..558c5092 100644
--- a/tests/providers/test_automotive.py
+++ b/tests/providers/test_automotive.py
@@ -48,7 +48,7 @@ class TestSkSk(_SimpleAutomotiveTestMixin):
 class TestPtBr(_SimpleAutomotiveTestMixin):
     """Test pt_BR automotive provider methods"""
 
-    license_plate_pattern: Pattern = re.compile(r"[A-Z]{3}-\d{4}")
+    license_plate_pattern: Pattern = re.compile(r"[A-Z]{3}-\d{1}[A-Z]{1}\d{2}")
 
 
 class TestPtPt(_SimpleAutomotiveTestMixin):
Repository: joke2k/faker
Pull request #1696 (2022-08-10 12:13:55)

automotive: add de_CH license plates
I've added an automotive provider for de_CH.


Patch:
diff --git a/faker/providers/automotive/de_CH/__init__.py b/faker/providers/automotive/de_CH/__init__.py
new file mode 100644
index 00000000..d6cfcbd8
--- /dev/null
+++ b/faker/providers/automotive/de_CH/__init__.py
@@ -0,0 +1,44 @@
+from .. import Provider as AutomotiveProvider
+
+
+class Provider(AutomotiveProvider):
+    """Implement automotive provider for ``de_CH`` locale.
+
+    Sources:
+
+    - https://de.wikipedia.org/wiki/Kontrollschild_(Schweiz)#Kantone
+    """
+
+    __canton = (
+        ("AG", "%## ###"),
+        ("AR", "%# ###"),
+        ("AI", "%# ###"),
+        ("BL", "%## ###"),
+        ("BS", "%## ###"),
+        ("BE", "%## ###"),
+        ("FR", "%## ###"),
+        ("GE", "%## ###"),
+        ("GL", "%# ###"),
+        ("GR", "%## ###"),
+        ("JU", "%# ###"),
+        ("LU", "%## ###"),
+        ("NE", "%## ###"),
+        ("NW", "%# ###"),
+        ("OW", "%# ###"),
+        ("SH", "%# ###"),
+        ("SZ", "%## ###"),
+        ("SO", "%## ###"),
+        ("SG", "%## ###"),
+        ("TI", "%## ###"),
+        ("TG", "%## ###"),
+        ("UR", "%# ###"),
+        ("VD", "%## ###"),
+        ("VS", "%## ###"),
+        ("ZG", "%## ###"),
+        ("ZH", "%## ###"),
+    )
+
+    def license_plate(self) -> str:
+        """Generate a license plate."""
+        plate: tuple = self.random_element(self.__canton)
+        return f"{plate[0]}-{self.numerify(plate[1])}".strip()


Test patch:
diff --git a/tests/providers/test_automotive.py b/tests/providers/test_automotive.py
index 558c5092..6d3f27af 100644
--- a/tests/providers/test_automotive.py
+++ b/tests/providers/test_automotive.py
@@ -304,3 +304,9 @@ class TestSqAl(_SimpleAutomotiveTestMixin):
     """Test sq_AL automotive providers methods"""
 
     license_plate_pattern: Pattern = re.compile(r"[A-Z]{2} \d{3}[A-Z]{2}")
+
+
+class TestDeCh(_SimpleAutomotiveTestMixin):
+    """Test de_CH automotive provider methods"""
+
+    license_plate_pattern: Pattern = re.compile(r"[A-Z]{2}-\d{1,3}\s?\d{0,3}")
Repository: joke2k/faker
Pull request #1843 (2023-04-07 19:23:27)

Added de_DE swift_location_codes
### What does this change

This fixes the issue found in #1823 and adds a test to verify this.

### What was wrong

Faker did not follow the norms for EBICS/SWIFT in de_De locale, specifically the regular expression [A-Z]{6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3})? . In other words, there must not be a 0 or 1 in the 1st place and no O in the 2nd place of the swift location code.

### How this fixes it

This adds the allowed list of swift location codes. Now if swift is called with "use_dataset=True" for "de_De" locale, it follows the rules. I am unsure if this the best way, since the rules should be followed even without "use_dataset=True" argument, but I see that this is how it has been implemented for other locales.



Patch:
diff --git a/faker/providers/bank/de_DE/__init__.py b/faker/providers/bank/de_DE/__init__.py
index 03d5459f..2ca16fd3 100644
--- a/faker/providers/bank/de_DE/__init__.py
+++ b/faker/providers/bank/de_DE/__init__.py
@@ -2,7 +2,20 @@ from .. import Provider as BankProvider
 
 
 class Provider(BankProvider):
-    """Implement bank provider for ``de_DE`` locale."""
+    """Implement bank provider for ``de_DE`` locale.
+
+    Source for rules for swift location codes:
+
+    - https://www.ebics.de/de/datenformate
+    """
 
     bban_format = "##################"
     country_code = "DE"
+
+    first_place = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "23456789"
+    second_place = "ABCDEFGHIJKLMNPQRSTUVWXYZ" + "0123456789"
+    swift_location_codes = []
+    for i in first_place:
+        for j in second_place:
+            swift_location_codes.append(str(i) + str(j))
+    swift_location_codes = tuple(swift_location_codes)


Test patch:
diff --git a/tests/providers/test_bank.py b/tests/providers/test_bank.py
index fc0ead4d..076f6c9a 100644
--- a/tests/providers/test_bank.py
+++ b/tests/providers/test_bank.py
@@ -271,6 +271,16 @@ class TestFrFr:
             assert re.fullmatch(r"\d{2}\d{23}", iban[2:])
 
 
+class TestDeDe:
+    """Test de_DE bank provider"""
+
+    def test_swift_use_dataset(self, faker, num_samples):
+        regex = re.compile("[A-Z]{6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3})?")
+        for _ in range(num_samples):
+            code = faker.swift(use_dataset=True)
+            assert regex.fullmatch(code) is not None
+
+
 class TestEnPh:
     """Test en_PH bank provider"""