[ANN] NamSor.jl: Julia wrappers for NamSor v2 API

Namsor is a name checker for gender, origin and ethnicity determination.

This Julia package wrap the NamSor Web API.

API key

Please apply for your NamSor API key first. Then paste your api key at $HOME/.config/NAMSOR_KEY.txt. Or save api key to NAMSOR_KEY environment variable.

Initialization

Before calling the NamSor interface, you need to initialize the corresponding NamSor API through init_api(). For example, analyzes name “Julia Fox” to identify its country of origin.

julia> using NamSor
julia> personal_api = init_api(APIClient.PersonalApi)
julia> first(origin(personal_api,"Julia","Fox"))
{
  "script": "LATIN",
  "id": "0893c8d7-4f9e-4718-8946-d2fcdd7929a2",
  "firstName": "Julia",
  "lastName": "Fox",
  "countryOrigin": "IE",
  "countryOriginAlt": "GB",
  "countriesOriginTop": [
    "IE",
    "GB",
    "ES",
    "IL",
    "NA",
    "PT",
    "SK",
    "DE",
    "BE",
    "FR"
  ],
  "score": 2.994869283184946,
  "regionOrigin": "Europe",
  "topRegionOrigin": "Europe",
  "subRegionOrigin": "Northern Europe",
  "probabilityCalibrated": 0.5070530505259684,
  "probabilityAltCalibrated": 0.8538791383744339
}

The “countryOrigin” field shows she might be Irish.

1 Like