Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Nim wrapper for the Agify.io API

License

nemuelw/nim-agify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Releases

No releases published

Packages

No packages published

Languages