Project

census_for

0.0
No commit activity in last 3 years
No release in over 3 years
Initial version: Gem returns population data for US States, Counties, including Puerto Rico, US territories.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 0
~> 10.0
~> 3.0

Runtime

 Project Readme

CensusFor

v. 1.1

CensusFor lets you quickly return 2014 US Census data for States and Counties, including Puerto Rico municipios. Returns correctly styled USA county text, ie. "juneau ak" ==> "Juneau City and Borough, Alaska"

Installation

Add this line to your application's Gemfile:

gem 'census_for'

And then execute:

$ bundle

Or install it yourself as:

$ gem install census_for

Usage

For quick US County population estimates:

$ CensusFor::County.population("AnyCounty, AnyState")

Example:

CensusFor::County.population("Travis County, Texas")
CensusFor::County.population("fulton ga"
CensusFor::County.population("East Baton Rouge Parish, LA")
CensusFor::County.population("ponce municipio, pr")

For the first above example, "Travis County, Texas", returns:

$ =>  1151145

County .population method uses the following to parse_city_state submissions:

$ CensusFor::County.parse_county_state("AnyCounty, AnyState")

Example:

CensusFor::County.parse_county_state("Baldwin, AL")
CensusFor::County.parse_county_state("ponce pr")
CensusFor::County.parse_county_state("lafourche, LA")
CensusFor::County.parse_county_state("Juneau, AK")

For these examples, returns:

$ =>  "Baldwin County, Alabama"
$ =>  "Ponce Municipio, Puerto Rico"
$ =>  "Lafourche Parish, Louisiana"
$ =>  "Juneau City and Borough, Alaska"

For quick State Census retrieval:

CensusFor::State.population("AnyState")

Example:

CensusFor::State.population("GA")
CensusFor::State.population("new york")

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/evo21/census_for.

License

The gem is available as open source under the terms of the MIT License.