mirror of
https://github.com/nemuelw/genderize
synced 2026-01-01 23:10:39 +00:00
No description
| src | ||
| .gitignore | ||
| genderize.nimble | ||
| LICENSE | ||
| README.md | ||
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
predictGenderandpredictGendersmethods 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.