Skip to main content

An asynchronous set of bindings for the three Demografix APIs - Genderize, Agify and Nationalize

Project description

demograpyx

A set of asynchronous bindings for the three Demograpix APIs: genderize, agify and nationalize

Installation

Requires Python 3.10 or newer

$ pip install demograpyx

Example usage

Functions are identical across all three API clients (predict, batch_predict)

import asyncio
from demograpyx import Genderize, CountryCode

async def main() -> None:
    genderize = await Genderize.create() # optionally pass api_key kwarg for API key
    # alternatively, initialise an aiohttp.ClientSession and pass it as a kwarg
    # genderize = Genderize(session=aiohttp.ClientSession())

    data = await genderize.predict("Mike", country_id=CountryCode.UnitedStates) # country_id argument is optional, will improve prediction accuracy
    print(data)
    # GenderPrediction(count=675221, name='Mike', gender='male', probability=1.0, country_id='US')

if __name__ == "__main__":
    asyncio.run(main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

demograpyx-1.0.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

demograpyx-1.0.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file demograpyx-1.0.0.tar.gz.

File metadata

  • Download URL: demograpyx-1.0.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.1 Windows/10

File hashes

Hashes for demograpyx-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8b5be5106fea0e9c0a7dc1516be2e9b13f4f42ba2159ca897092701379481a03
MD5 86521bc5fb57d45c1d8af98728f94d73
BLAKE2b-256 088645b8fe2b425d2765639921703e4b0cdfe21b855a1398e5f44b3ba6925158

See more details on using hashes here.

File details

Details for the file demograpyx-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: demograpyx-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.1 Windows/10

File hashes

Hashes for demograpyx-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fcf3c6ef13a54188a6eb8e84bc6009fa329772a8bedb46bf14c94a7a3eac605c
MD5 17f99fe81699ee4261fcd8d7a40e7379
BLAKE2b-256 b32043be989941d6fe72f5309b4e39b8f530b71adc553ab4fd93b5662f844924

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page