joke2k / faker

Faker is a Python package that generates fake data for you.
https://faker.readthedocs.io
MIT License
17.61k stars 1.92k forks source link

Updating land_coords used in local_latlng() to cover every supported country code #2001

Closed Beblu closed 6 months ago

Beblu commented 6 months ago

When using faker.local_latlng method I thought that it has exported locations from geonames.org for every possible country code (which can be generated by faker itself), but it turned out that we have a list of possible locations in faker/faker/providers/geo/__init__.py::Provider:land_coords

Hard-coded values are not the problem though, but the lack of locations for some countries (like mentioned below Grenada (GD)).

Is it possible to update land_coords with additional locations?

Steps to reproduce

x= faker.local_latlng(country_code="GD")

Expected behavior

Something similar to: X is ('12.722', '-61.3729', 'Grenville', 'GD', 'Grenada')

Actual behavior

X is None

lozik4 commented 6 months ago

I added ("12.12278", "-61.62498", "Grenville", "GD", "America/Grenada"), Info from https://www.geonames.org/3580236/grenville.html