mirror of
https://github.com/nemuelw/nim-agify
synced 2026-01-13 06:11:37 +00:00
No description
| src | ||
| .gitignore | ||
| agify.nimble | ||
| LICENSE | ||
| README.md | ||
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
predictAgeandpredictAgesmethods 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.