def get_gender_from_wiki_claims(clm_dict):
    """
    From clim_dict produced by pywikibot from a page, tries to extract the gender of the object of the page
    If it fails returns None
    N.B. Wikidata's categories for transgender male and female are treated as male and female, respectively

    >>> from gender_novels.corpus_gen import get_gender_from_wiki_claims
    >>> site = pywikibot.Site("en", "wikipedia")
    >>> page = pywikibot.Page(site, 'Zeus')
    >>> item = pywikibot.ItemPage.fromPage(page)
    >>> dictionary = item.get()
    >>> clm_dict = dictionary["claims"]
    >>> get_gender_from_wiki_claims(clm_dict)
    'male'

    :param clm_dict: dict
    :return: str
    """
    try:
        clm_list = clm_dict["P21"]
        gender_id = None
        for clm in clm_list:
            clm_trgt = clm.getTarget()
            gender_id = clm_trgt.id
        if (gender_id == 'Q6581097' or gender_id == 'Q2449503'):
            return 'male'
        if (gender_id == 'Q6581072' or gender_id == 'Q1052281'):
            return 'female'
        if (gender_id == 'Q1097630'):
            return 'non-binary'
    except (KeyError, AttributeError):
        return None