https://github.com/steelpangolin/go-genderize
Client for Genderize.io web service.
https://github.com/steelpangolin/go-genderize
api-client gender-classification gender-from-name golang
Last synced: 2 months ago
JSON representation
Client for Genderize.io web service.
- Host: GitHub
- URL: https://github.com/steelpangolin/go-genderize
- Owner: SteelPangolin
- License: mit
- Created: 2015-07-27T04:03:42.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-12-21T22:25:24.000Z (almost 7 years ago)
- Last Synced: 2025-03-05T16:52:30.944Z (7 months ago)
- Topics: api-client, gender-classification, gender-from-name, golang
- Language: Go
- Homepage: https://bat-country.us/#genderize
- Size: 8.79 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Genderize
[](https://github.com/SteelPangolin/go-genderize)
[](https://travis-ci.org/SteelPangolin/go-genderize)
[](https://codecov.io/gh/SteelPangolin/go-genderize)Go client for the [Genderize.io](https://genderize.io/) web service.
[Full API documentation is available on GoDocs](https://godoc.org/github.com/SteelPangolin/go-genderize).
## Basic usage
Simple interface with minimal configuration.
### Code
```go
responses, err := Get([]string{"James", "Eva", "Thunderhorse"})
if err != nil {
panic(err)
}
for _, response := range responses {
fmt.Printf("%s: %s\n", response.Name, response.Gender)
}
```### Output
```
James: male
Eva: female
Thunderhorse:
```## Advanced usage
Client with custom API key and user agent, query with language and country IDs.
### Code
```go
client, err := NewClient(Config{
UserAgent: "GoGenderizeDocs/0.0",
// Note that you'll need to use your own API key.
APIKey: "",
})
if err != nil {
panic(err)
}
responses, err := client.Get(Query{
Names: []string{"Kim"},
CountryID: "dk",
LanguageID: "da",
})
if err != nil {
panic(err)
}
for _, response := range responses {
fmt.Printf("%s: %s\n", response.Name, response.Gender)
}
```### Output
```
Kim: male
```## Release checklist
1. Generate a new version number: `major.minor.micro`. It should be compatible with [SemVer 2.0.0](https://semver.org/).
2. Update `Version` in `genderize.go`.
3. Add a changelog entry and date for the new version in `CHANGES.md`.
4. Commit the changes. This may be done as part of another change.
5. Tag the commit with `git tag major.minor.micro`.
6. Push the tag to GitHub with `git push origin major.minor.micro`.