All Projects → moneals → addresser

moneals / addresser

Licence: MIT license
Street Address Parser for Node.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to addresser

react-thailand-address-typeahead
jquery.Thailand.js in React
Stars: ✭ 78 (+271.43%)
Mutual labels:  address
cryptaddress.now
A minimal service to detect which cryptocurrency an address corresponds to.
Stars: ✭ 23 (+9.52%)
Mutual labels:  address
VzAddress-Craft
Address fieldtype for the Craft CMS
Stars: ✭ 30 (+42.86%)
Mutual labels:  address
address-index-api
Address Index is an application which resolves addresses
Stars: ✭ 26 (+23.81%)
Mutual labels:  address
ViaCEP
The ViaCEP API/webservice .NET client
Stars: ✭ 21 (+0%)
Mutual labels:  address
cosmospy
Python tools for Cosmos wallet management and offline transaction signing
Stars: ✭ 57 (+171.43%)
Mutual labels:  address
python-censusbatchgeocoder
A simple Python wrapper for U.S. Census Geocoding Services API batch service
Stars: ✭ 40 (+90.48%)
Mutual labels:  address
flutter jd address selector
京东地址选择器
Stars: ✭ 26 (+23.81%)
Mutual labels:  address
pyunit-address
字符串地址查询,支持自定义地址词库,解析地址,地址识别,地址抽取,中文地址.
Stars: ✭ 70 (+233.33%)
Mutual labels:  address
bitcoincashjs
WARNING: This project is no longer maintained. Please, use bitcore-lib-cash instead.
Stars: ✭ 80 (+280.95%)
Mutual labels:  address
m2.ShowAddressFields
Magento2. Show Address Fields in Customer Registration Form.
Stars: ✭ 17 (-19.05%)
Mutual labels:  address
cashaddress
Python tool for convert bitcoin cash legacy addresses
Stars: ✭ 40 (+90.48%)
Mutual labels:  address
geocoding
地理编码技术,提供地址标准化和相似度计算。
Stars: ✭ 148 (+604.76%)
Mutual labels:  address
wipri
(Network Metadata Privacy) MAC Address spoofer with bonus combo (options): hostname + signal spoofer - *no disconnects!* Privacy Changing w/Brand Mimics: run as command or optional new randomized identity each boot; includes flags for continually changing random times/changing valid OUI addresses + Hostname randomizer + Device/Signal/location an…
Stars: ✭ 26 (+23.81%)
Mutual labels:  address
street-address
Street address parser and formatter
Stars: ✭ 86 (+309.52%)
Mutual labels:  address
ethereum-checksum-address
Convert Ethereum address to a checksummed address
Stars: ✭ 20 (-4.76%)
Mutual labels:  address
net-EmailAddress
Multiple implementations on email address validation.
Stars: ✭ 12 (-42.86%)
Mutual labels:  address
tz-trout
Helps you figure out the time zone based on an address or a phone number.
Stars: ✭ 14 (-33.33%)
Mutual labels:  address
FGRoute
Get your device ip address, router ip or wifi ssid
Stars: ✭ 128 (+509.52%)
Mutual labels:  address
PSCityPickerView
城市选择器,可以选择国内所有的城市和地区
Stars: ✭ 47 (+123.81%)
Mutual labels:  address

addresser Build Status Coverage Status npm version

A Node.js library for parsing property addresses. Also includes other address utilities such as a function that returns a random city.

Installation

npm install addresser

Usage

var addresser = require('addresser');

// Isn't confused by duplicate place names
console.log(addresser.parseAddress("400 South Orange Ave, South Orange , NJ 07079"););

{ id: '400-South-Orange-Ave,-South-Orange,-NJ-07079',
  formattedAddress: '400 South Orange Ave, South Orange, NJ 07079',
  zipCode: '07079',
  stateAbbreviation: 'NJ',
  stateName: 'New Jersey',
  placeName: 'South Orange',
  addressLine1: '400 South Orange Ave',
  streetNumber: '400',
  streetSuffix: 'Ave',
  streetName: 'South Orange' }

// Handles extra whitespace
console.log(addresser.parseAddress("123 Double  Space    St, Conway, SC 29526"));

{ id: '123-Double-Space-St,-Conway,-SC-29526',
  formattedAddress: '123 Double Space St, Conway, SC 29526',
  streetNumber: '123',
  streetSuffix: 'St',
  streetName: 'Double Space',
  addressLine1: '123 Double Space St',
  placeName: 'Conway',
  stateAbbreviation: 'SC',
  stateName: 'South Carolina',
  zipCode: '29526' }

// normalizes to Title Case  
console.log(addresser.parseAddress("123 Main St, Conway, south carolina 29526-1234"));

{ id: '123-Main-St,-Conway,-SC-29526',
  formattedAddress: '123 Main St, Conway, SC 29526',
  streetNumber: '123',
  streetSuffix: 'St',
  streetName: 'Main',
  addressLine1: '123 Main St',
  placeName: 'Conway',
  stateAbbreviation: 'SC',
  stateName: 'South Carolina',
  zipCode: '29526',
  zipCodePlusFour: '29526-1234'}

// Handles secondary address lines even without delimiters.
// Normalizes street types to standard abbreviations.
console.log(addresser.parseAddress("1301 Columbia College Drive Unit 101 Columbia, SC 29203"));

{ id: '1301-Columbia-College-Dr,-Unit-101,-Columbia,-SC-29203',
  formattedAddress: '1301 Columbia College Dr, Unit 101, Columbia, SC 29203',
  zipCode: '29203',
  stateAbbreviation: 'SC',
  stateName: 'South Carolina',
  placeName: 'Columbia',
  addressLine1: '1301 Columbia College Dr',
  addressLine2: 'Unit 101',
  streetNumber: '1301',
  streetSuffix: 'Dr',
  streetName: 'Columbia College' }       

// Handles trailing street directionals  
console.log(addresser.parseAddress("300 BOYLSTON AVE E SEATTLE WA 98102"));
{ id: '300-Boylston-Ave-E,-Seattle,-WA-98102',
  formattedAddress: '300 Boylston Ave E, Seattle, WA 98102',
  zipCode: '98102',
  stateAbbreviation: 'WA',
  stateName: 'Washington',
  placeName: 'Seattle',
  addressLine1: '300 Boylston Ave E',
  streetDirection: 'E',
  streetNumber: '300',
  streetSuffix: 'Ave',
  streetName: 'Boylston' }

// Handles post office boxes 
console.log(addresser.parseAddress("PO BOX 333 SEATTLE WA 98102"));
{ id: 'PO-BOX-333,-Seattle,-WA-98102',
  formattedAddress: 'PO BOX 333, Seattle, WA 98102',
  zipCode: '98102',
  stateAbbreviation: 'WA',
  stateName: 'Washington',
  placeName: 'Seattle',
  addressLine1: 'PO BOX 333' }

// Return a random valid city 
console.log(addresser.randomCity());
{ city: 'Irwin',
  state: 'ID' }

// Return an object containing all cities
console.log(addresser.cities());
{ 
  ...
  WI:
    [ 
      'Black River Falls',
      'Heafford Junction',
      'Washington Island',
      ...
    ],
  WY:
    [ 
      'Yellowstone National Park',
      'Saint Stephens',
      'Little America',
      ...
    ]
} 

NOTE: Currently addresser supports only US & Canada addresses.

Functions

parseAddress

parseAddress will accept an address string and convert it into structured address data. Addresser is designed to be flexible and forgiving in terms of the formatting of the address string but it does assume a general order of street data, city data and state data from left to right. parseAddress will normalize state names and abbreviations and can recognize state data regardless of case or format.

parseAddress will try to validate that the city provided is valid for the given state. This allows for more intelligent parsing logic when propert delimiters are not used. parseAddress also normalizes street types to standard abberviations ie. Drive to Dr, Street to St, etc.

parseAddress creates a unique id for all addresses based on the parsed values. Currently there is no easy, universal ID available for property addresses and this package should help bridge that gap for developers who need to cross reference property data across multiple data sources. An id is generated only if all the address components are present including street address, city, state and zipcode.

getRandomCity

The getRandomCity function can be used to generate a random valid city. This can be helpful when testing.

cities

The cities function returns a JSON object that contains a list of all known cities and states. The structure is as follows:

{ 
  ...
  WI:
    [ 
      'Black River Falls',
      'Heafford Junction',
      'Washington Island',
      ...
    ],
  WY:
    [ 
      'Yellowstone National Park',
      'Saint Stephens',
      'Little America',
      ...
    ]
}

Tests

npm test

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].