Skip to content

fix: correct leading zeros and add building number patterns for DE_de address provider 🐛 #2209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KarelZe
Copy link
Contributor

@KarelZe KarelZe commented May 3, 2025

What does this change

This PR improves the building number generation for German addresses. Previously, we generated multi-digit building numbers with leading 0s, which do not exist in Germany. This pr also adds more patterns to better cover German building numbers.

In detail:

MWE

from faker import Faker
fake = Faker('de_DE')
for _ in range(100):
    print(fake.building_number())

before:

0/2
...
053
...
5/0
...
0/0

after:

0
17
438
185
98
29-28
52-84
7
1-9
6
13-43
78-20
62
75-79
11/67
47-78
95
60
739
67/88
5531
...

What was wrong

Pattern was wrong.

How this fixes it

It fixes the pattern for German building numbers and adds more patterns to sample from.

Checklist

  • I have read the documentation about CONTRIBUTING
  • I have read the documentation about Coding style
  • I have run make lint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant