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