No description
Find a file
2025-07-10 19:46:11 +03:00
src Initial commit 2025-07-09 22:08:25 +03:00
.gitignore Initial commit 2025-07-09 22:08:25 +03:00
LICENSE Create LICENSE 2025-07-10 19:46:11 +03:00
nationalize.nimble Initial commit 2025-07-09 22:08:25 +03:00
README.md Initial commit 2025-07-09 22:08:25 +03:00

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.