prosoponym


Nameprosoponym JSON
Version 1.2.3 PyPI version JSON
download
home_pagehttps://github.com/majormode/prosoponym-python-library
SummaryPython library to manage personal names (in onomastic terminology also known as prosoponyms)
upload_time2024-02-21 02:09:10
maintainer
docs_urlNone
authorDaniel CAUNE
requires_python>=3.9,<4.0
licenseSEE LICENSE IN <LICENSE.md>
keywords library prosoponym surname
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Prosoponym Python Library

Python library to format personal names (in onomastic terminology also known as prosoponyms).

A personal name is the set of names by which an individual person is known, with the understanding that, taken together, they all relate to that one individual.  A personal name is generally composed of first names, middle names and last names, which order varies depending on the culture the personal name is related to (western or eastern lexical name orders).

```python
>>> from majormode.perseus.model.locale import Locale
>>> from majormode.prosoponym import LexicalNameOrder
>>> from majormode.prosoponym import format_first_name
>>> from majormode.prosoponym import format_full_name
>>> from majormode.prosoponym import format_last_name

>>> format_first_name("Aline Maria")
'Aline Maria'
>>> format_last_name("caune ly")
'CAUNE LY'

>>> format_full_name("alfred thanh phuc", "pham", Locale('fra'))
'Alfred Thanh Phuc PHAM'
>>> format_full_name("alfred thanh phuc", "pham", Locale('vie'))
'PHAM Alfred Thanh Phuc'

>>> format_full_name("alfred", "pham", Locale('vie'), full_name="pham thanh phuc")
ValueError: None of the first name words has been found in the full name
>>> format_full_name("alfred phuc", "pham", Locale('fra'), full_name="pham thanh phuc")
ValueError: The parts of the full name are not written in the expected order
>>> format_full_name("alfred phuc", "pham", Locale('fra'), full_name="alfred thanh phuc pham")
'Alfred Thanh Phuc PHAM'
>>> format_full_name("alfred phuc", "pham", Locale('vie'), full_name="Phạm thanh phúc alfred")
'PHẠM Thanh Phúc Alfred'

>>> # If a last name is composed of two or more words, while the full name
>>> # follows western lexical order, this two or more words SHOULD be 
>>> # in the full name (otherwise the function won't be able to determine
>>> # included in the full name, but not necessary.
>>> format_full_name("Aline", "Caune ly", Locale('fra'), full_name="aline minh anh maria caune ly")  # OK
'Aline Minh Anh Maria CAUNE LY'
>>> format_full_name("Aline", "Caune", Locale('fra'), full_name="aline minh anh maria caune ly")  # Still OK, even if incoherent input
'Aline Minh Anh Maria CAUNE LY'

>>> format_full_name("truc", "nguyen", Locale('vie'), full_name="nguyen thi thanh truc maria")
'NGUYEN Thi Thanh Truc Maria'

>>> # If a last name is composed of two or more words, while the full name
>>> # follows eastern lexical order, this two or more words MUST be included
>>> # in the full name (otherwise the function won't be able to determine
>>> # which parts of the name correspond to the last name or to the 
>>> # possible middle name).
>>> format_full_name("Thao nguyen", "nguyen le", Locale('vie'), "Nguyễn Lê thị Thảo Nguyên")
'NGUYỄN LÊ Thị Thảo Nguyên'  # OK
>>> format_full_name("Thao nguyen", "nguyen le", Locale('vie'), "Nguyễn thị Thảo Nguyên")  # Still OK, even if incoherent input
'NGUYỄN Thị Thảo Nguyên'
>>> format_full_name("Thao nguyen", "nguyen", Locale('vie'), "Nguyễn Lê thị Thảo Nguyên")  # Not OK! Part of the last name is missing.
'NGUYỄN Lê Thị Thảo Nguyên'
```
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/majormode/prosoponym-python-library",
    "name": "prosoponym",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "library,prosoponym,surname",
    "author": "Daniel CAUNE",
    "author_email": "daniel.caune@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/62/93/84c759576de598cfc2ee0077a67b23ee44c04311927981f80da9d9a72252/prosoponym-1.2.3.tar.gz",
    "platform": null,
    "description": "# Prosoponym Python Library\n\nPython library to format personal names (in onomastic terminology also known as prosoponyms).\n\nA personal name is the set of names by which an individual person is known, with the understanding that, taken together, they all relate to that one individual.  A personal name is generally composed of first names, middle names and last names, which order varies depending on the culture the personal name is related to (western or eastern lexical name orders).\n\n```python\n>>> from majormode.perseus.model.locale import Locale\n>>> from majormode.prosoponym import LexicalNameOrder\n>>> from majormode.prosoponym import format_first_name\n>>> from majormode.prosoponym import format_full_name\n>>> from majormode.prosoponym import format_last_name\n\n>>> format_first_name(\"Aline Maria\")\n'Aline Maria'\n>>> format_last_name(\"caune ly\")\n'CAUNE LY'\n\n>>> format_full_name(\"alfred thanh phuc\", \"pham\", Locale('fra'))\n'Alfred Thanh Phuc PHAM'\n>>> format_full_name(\"alfred thanh phuc\", \"pham\", Locale('vie'))\n'PHAM Alfred Thanh Phuc'\n\n>>> format_full_name(\"alfred\", \"pham\", Locale('vie'), full_name=\"pham thanh phuc\")\nValueError: None of the first name words has been found in the full name\n>>> format_full_name(\"alfred phuc\", \"pham\", Locale('fra'), full_name=\"pham thanh phuc\")\nValueError: The parts of the full name are not written in the expected order\n>>> format_full_name(\"alfred phuc\", \"pham\", Locale('fra'), full_name=\"alfred thanh phuc pham\")\n'Alfred Thanh Phuc PHAM'\n>>> format_full_name(\"alfred phuc\", \"pham\", Locale('vie'), full_name=\"Ph\u1ea1m thanh ph\u00fac alfred\")\n'PH\u1ea0M Thanh Ph\u00fac Alfred'\n\n>>> # If a last name is composed of two or more words, while the full name\n>>> # follows western lexical order, this two or more words SHOULD be \n>>> # in the full name (otherwise the function won't be able to determine\n>>> # included in the full name, but not necessary.\n>>> format_full_name(\"Aline\", \"Caune ly\", Locale('fra'), full_name=\"aline minh anh maria caune ly\")  # OK\n'Aline Minh Anh Maria CAUNE LY'\n>>> format_full_name(\"Aline\", \"Caune\", Locale('fra'), full_name=\"aline minh anh maria caune ly\")  # Still OK, even if incoherent input\n'Aline Minh Anh Maria CAUNE LY'\n\n>>> format_full_name(\"truc\", \"nguyen\", Locale('vie'), full_name=\"nguyen thi thanh truc maria\")\n'NGUYEN Thi Thanh Truc Maria'\n\n>>> # If a last name is composed of two or more words, while the full name\n>>> # follows eastern lexical order, this two or more words MUST be included\n>>> # in the full name (otherwise the function won't be able to determine\n>>> # which parts of the name correspond to the last name or to the \n>>> # possible middle name).\n>>> format_full_name(\"Thao nguyen\", \"nguyen le\", Locale('vie'), \"Nguy\u1ec5n L\u00ea th\u1ecb Th\u1ea3o Nguy\u00ean\")\n'NGUY\u1ec4N L\u00ca Th\u1ecb Th\u1ea3o Nguy\u00ean'  # OK\n>>> format_full_name(\"Thao nguyen\", \"nguyen le\", Locale('vie'), \"Nguy\u1ec5n th\u1ecb Th\u1ea3o Nguy\u00ean\")  # Still OK, even if incoherent input\n'NGUY\u1ec4N Th\u1ecb Th\u1ea3o Nguy\u00ean'\n>>> format_full_name(\"Thao nguyen\", \"nguyen\", Locale('vie'), \"Nguy\u1ec5n L\u00ea th\u1ecb Th\u1ea3o Nguy\u00ean\")  # Not OK! Part of the last name is missing.\n'NGUY\u1ec4N L\u00ea Th\u1ecb Th\u1ea3o Nguy\u00ean'\n```",
    "bugtrack_url": null,
    "license": "SEE LICENSE IN <LICENSE.md>",
    "summary": "Python library to manage personal names (in onomastic terminology also known as prosoponyms)",
    "version": "1.2.3",
    "project_urls": {
        "Homepage": "https://github.com/majormode/prosoponym-python-library",
        "Repository": "https://github.com/majormode/prosoponym-python-library"
    },
    "split_keywords": [
        "library",
        "prosoponym",
        "surname"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2c262fe03ba428c2761a38da0802eaf571b1592d97cbf36b45226660e8f26465",
                "md5": "4a06777bee0bde60188c420f27a8ff2d",
                "sha256": "1a53d5df7fde7f1f4d62ff6a59958f439311f989a15e203acb06d87582fe8dbd"
            },
            "downloads": -1,
            "filename": "prosoponym-1.2.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4a06777bee0bde60188c420f27a8ff2d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 14236,
            "upload_time": "2024-02-21T02:09:07",
            "upload_time_iso_8601": "2024-02-21T02:09:07.994283Z",
            "url": "https://files.pythonhosted.org/packages/2c/26/2fe03ba428c2761a38da0802eaf571b1592d97cbf36b45226660e8f26465/prosoponym-1.2.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "629384c759576de598cfc2ee0077a67b23ee44c04311927981f80da9d9a72252",
                "md5": "65e3c25ab26c0bdf713531e0f748218b",
                "sha256": "e97845a95dce80c95c0449f1f61e58f158f90f92049be6454c878c29b7948d62"
            },
            "downloads": -1,
            "filename": "prosoponym-1.2.3.tar.gz",
            "has_sig": false,
            "md5_digest": "65e3c25ab26c0bdf713531e0f748218b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 14047,
            "upload_time": "2024-02-21T02:09:10",
            "upload_time_iso_8601": "2024-02-21T02:09:10.045774Z",
            "url": "https://files.pythonhosted.org/packages/62/93/84c759576de598cfc2ee0077a67b23ee44c04311927981f80da9d9a72252/prosoponym-1.2.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-21 02:09:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "majormode",
    "github_project": "prosoponym-python-library",
    "github_not_found": true,
    "lcname": "prosoponym"
}
        
Elapsed time: 0.19303s