address()¶
- Faker.address()
Generate one or more fake addresses for a given country (synchronous).
- Parameters:
country_code – ISO 3166-1 alpha-2 country code (case-insensitive), e.g.
"us","GB","fr".amount – Number of addresses to generate. Defaults to
1. Capped at the number of records available for the country.fields – If given, only these keys are kept in each returned address dictionary.
locale – If given, prefixes the
person_namefield with"<locale>_".
- Returns:
A single address
dictwhenamount=1, otherwise alistof address dicts. Every dict carriesapi_owner,api_updatesandcountry_flagmetadata.- Raises:
ValueError – If
country_codeis empty, unknown, or has no bundled records.
Example:
addr = faker.address("us") five = faker.address("fr", amount=5, fields=["city", "zip"])