Skip to content

Add method to generate a full address #2011

@matthewmayer

Description

@matthewmayer

Clear and concise description of the problem

There's no way to generate a "full" address e.g. street, city, state and ZIP together in a locale-aware way.

Different locales write addresses differently, e.g. in some locales you write secondary address before street address, in others vice versa. In some locales you write ZIP code/postcode together with city, in others you write on a seperate line, and some locales dont have ZIPs at all. Some locales go "most to least specific" (e.g. en_US) and some go "least to most specific" (e.g. zh_CN). Some locales utilize the secondary admin area (e.g. county) and some don't.

Suggested solution

Implement faker.location.address() or faker.location.fullAddress() and an associated definition pattern for each locale which might combine some or all of

  • streetAddress
  • city
  • county
  • state
  • stateAbbr
  • zipCode

Alternative

manually construct address from the pieces, but then if you change locales you have to change the pattern.

Additional context

Might need the option to do it as a single line address or multiline

Metadata

Metadata

Assignees

Labels

c: featureRequest for new featurem: locationSomething is referring to the location modules: waiting for user interestWaiting for more users interested in this feature

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions