Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Nim wrapper for the Genderize.io API

License

nemuelw/genderize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

genderize

Nim wrapper for the Genderize.io API

Installation

nimble install genderize

Usage

Import the package

import genderize

Initialize a client

let client = newGenderizeClient("OPTIONAL_API_KEY")

Predict the gender of a single name

let genderResult = client.predictGender("Nemuel")
if isOk(genderResult):
  echo genderResult.value.gender
else: echo genderResult.error

Predict the genders of multiple names

let gendersResult = client.predictGenders(@["Nemuel", "Kira"])
if isOk(gendersResult):
  for result in gendersResult.value:
    echo result.gender
else: echo gendersResult.error

Both the predictGender and predictGenders methods have an optional second parameter (a 2-letter country ID e.g. KE)

Contributing

Contributions are welcome! Feel free to create an issue or open a pull request.

License

This project is licensed under the terms of the GNU GPL v3.0 License.

Releases

No releases published

Packages

No packages published

Languages