Code Climate Test Coverage Build Status


Start by adding it to your Gemfile and bundle it:

gem 'genderize_io_rb'

Now check a name like this:

gir =
res = gir.info_for_name("kasper")
puts "Name: #{}"
puts "Gender: #{res.gender}"

It is also possible to look multiple names up: do |gir|
  gir.info_for_names(["kasper", "christina"]).each do |result|
    puts "Name: #{}"
    puts "Gender: #{result.gender}"

You can attach a database-cache through a Baza::Db if Genderize is a bit slow:

# SQLite3 database will automatically be created with table and everything. If an existing db is given, the table will automatically be created within it. "sqlite3", path: path) do |db| db) do |gir|
    # First request will be done through a HTTP request:
    first_result = gir.info_for_name("kasper")
    puts "Through HTTP?: #{first_result.from_http_request?}"

    # Second result will be done by a
    second_result = gir.info_for_name("kasper")
    puts "Through DB cache? #{second_result.from_cache_db?}"

If you need the connections to be kept open:

db = "sqlite3", path: path)
gir = db)

Contributing to genderize_io_rb

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
  • Fork the project.
  • Start a feature/bugfix branch.
  • Commit and push until you are happy with your contribution.
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.


Copyright (c) 2013 Kasper Johansen. See LICENSE.txt for further details.