https://github.com/nemuelw/nim-agify
Nim wrapper for the Agify.io API
https://github.com/nemuelw/nim-agify
agify agify-api agifyio api-client api-client-nim api-wrapper nim nim-lang nim-wrapper
Last synced: 11 months ago
JSON representation
Nim wrapper for the Agify.io API
- Host: GitHub
- URL: https://github.com/nemuelw/nim-agify
- Owner: nemuelw
- License: gpl-3.0
- Created: 2025-07-08T20:34:09.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-09T18:42:36.000Z (11 months ago)
- Last Synced: 2025-07-10T03:41:16.884Z (11 months ago)
- Topics: agify, agify-api, agifyio, api-client, api-client-nim, api-wrapper, nim, nim-lang, nim-wrapper
- Language: Nim
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# agify
Nim wrapper for the [Agify.io](https://agify.io) API
## Installation
```bash
nimble install agify
```
## Usage
### Import the package
```nim
import agify
```
### Initialize a client
```nim
let client = newAgifyClient("OPTIONAL_API_KEY")
```
### Predict the age of a single name
```nim
let ageResult = predictAge("Nemuel")
if isOk(ageResult):
echo ageResult.value.age
else: echo ageResult.error
```
### Predict the ages of multiple names
```nim
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](https://www.gnu.org/licenses/gpl-3.0.html).