Skip to content

n3mu3lw/nationalize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nationalize

Nim wrapper for the Nationalize.io API

Installation

nimble install nationalize

Usage

Import the package

import nationalize

Initialize a client

let client = newNationalizeClient("OPTIONAL_API_KEY")

Predict the nationality of a single name

let nationalityResult = client.predictNationality("Nemuel")
if isOk(nationalityResult):
  echo nationalityResult.value.country
else: echo nationalityResult.error

Predict the nationalities of multiple names

let nationalitiesResult = client.predictNationalities(@["Nemuel", "Kira"])
if isOk(nationalitiesResult):
  for result in nationalitiesResult.value:
    echo result.country
else: echo nationalitiesResult.error

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

 
 
 

Contributors

Languages