Coder Social home page Coder Social logo

statestyle-js's Introduction

StatestyleJS

StatestyleJS is a Javascript port of latimes-statestyle—a Python library that standardizes the names of U.S. states.

Submit a state’s name, postal code or Associated Press abbreviation or FIPS code and receive a clean object with all other formats as attributes. State objects also provide the “stateface” code for ProPublica’s webfont of state shapes.

###Usage

Just pass a state's name, postal code, or even Associated Press abbreviation into statestyle.get():

> a = statestyle.get('IL')
{ name: 'Illinois',
  postal: 'IL',
  fips: '17',
  ap: 'Ill.',
  type: 'state',
  stateface: 'N' }
> a.name
'Illinois'
> a.ap
'Ill.'

Or pass in a state's FIPS code:

> statestyle.get(15)
{ name: 'Hawaii',
  postal: 'HI',
  fips: '15',
  ap: 'Hawaii',
  type: 'state',
  stateface: 'K' }

statestyle-js's People

Contributors

duner avatar

Stargazers

Paige Leskin avatar Chris Zubak-Skees avatar Logan Frederick avatar Troy Griggs avatar Aaron Williams avatar Ben Welsh avatar Andrew Chavez avatar Al Johri avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.