No description
Find a file
2025-07-09 21:42:29 +03:00
src Improvide function naming & docs 2025-07-09 21:42:29 +03:00
.gitignore Initial commit 2025-07-09 20:48:30 +03:00
agify.nimble Fix dependencies list 2025-07-09 20:53:20 +03:00
LICENSE Fix dependencies list 2025-07-09 20:53:20 +03:00
README.md Improvide function naming & docs 2025-07-09 21:42:29 +03:00

agify

Nim wrapper for the Agify.io API

Installation

nimble install agify

Usage

Import the package

import agify

Initialize a client

let client = newAgifyClient("OPTIONAL_API_KEY")

Predict the age of a single name

let ageResult = predictAge("Nemuel")
if isOk(ageResult):
  echo ageResult.value.age
else: echo ageResult.error

Predict the ages of multiple names

let agesResult = predictAges(@["Nemuel", "Kira"])
if isOk(agesResult):
  for result in agesResult.value:
    echo result.age
else: echo agesResult.error

Both the predictAge and predictAges 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.