{"id":13935737,"url":"https://github.com/petrovich/pytrovich","last_synced_at":"2025-06-23T11:36:44.351Z","repository":{"id":45719478,"uuid":"94031496","full_name":"petrovich/pytrovich","owner":"petrovich","description":"Python3 port of Petrovich, an inflector (and gender detector) for Russian anthroponyms","archived":false,"fork":false,"pushed_at":"2023-02-25T11:05:01.000Z","size":69,"stargazers_count":32,"open_issues_count":3,"forks_count":2,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-23T02:17:02.023Z","etag":null,"topics":["inflection","natural-language-processing","python","russian-language"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/petrovich.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-11T20:58:51.000Z","updated_at":"2025-04-06T21:30:04.000Z","dependencies_parsed_at":"2024-04-27T23:46:25.500Z","dependency_job_id":null,"html_url":"https://github.com/petrovich/pytrovich","commit_stats":{"total_commits":25,"total_committers":2,"mean_commits":12.5,"dds":0.12,"last_synced_commit":"81c8d254f8b233abe275eaea1fc05e1e6dc0edd2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/petrovich/pytrovich","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrovich%2Fpytrovich","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrovich%2Fpytrovich/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrovich%2Fpytrovich/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrovich%2Fpytrovich/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/petrovich","download_url":"https://codeload.github.com/petrovich/pytrovich/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrovich%2Fpytrovich/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261469956,"owners_count":23163192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["inflection","natural-language-processing","python","russian-language"],"created_at":"2024-08-07T23:02:03.187Z","updated_at":"2025-06-23T11:36:39.340Z","avatar_url":"https://github.com/petrovich.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"![Pytrovich](pytrovich.png)\n==========================================\n\n__pytrovich__ is a Python 3.6+ port of [petrovich library](https://github.com/petrovich) which inflects Russian names \nto a given grammatical case. It supports first names, last names and middle names inflections. Since version 0.0.2,\ngender detection is also available. \n\n[petrovich-java](https://github.com/petrovich/petrovich-java) was the main inspiration.\n\n__The alternative (earlier) port__: [Petrovich](https://github.com/damirazo/Petrovich)  ([@alexeyev](https://github.com/alexeyev) was not aware of it at the time of porting `petrovich` to Python). \nThe only meaningful difference we have found is that it does not support gender detection.\n\n\n![Python 3x](https://img.shields.io/badge/python-3.x-blue.svg)\n[![PyPI version][pypi_badge]][pypi_link]\n[![Downloads](https://pepy.tech/badge/pytrovich)](https://pepy.tech/project/pytrovich)\n\n[pypi_badge]: https://badge.fury.io/py/pytrovich.svg\n[pypi_link]: https://pypi.python.org/pypi/pytrovich\n\n## Installation\nShould be as simple as that\n```bash\npip install pytrovich\n```\n\n## Usage\n\n### Inflection\n\n```python\nfrom pytrovich.enums import NamePart, Gender, Case\nfrom pytrovich.maker import PetrovichDeclinationMaker\n\nmaker = PetrovichDeclinationMaker()\nprint(maker.make(NamePart.FIRSTNAME, Gender.MALE, Case.GENITIVE, \"Иван\"))  # Ивана\nprint(maker.make(NamePart.LASTNAME, Gender.MALE, Case.INSTRUMENTAL, \"Иванов\"))  # Ивановым\nprint(maker.make(NamePart.MIDDLENAME, Gender.FEMALE, Case.DATIVE, \"Ивановна\"))  # Ивановне\n```\n\n### Gender detection\n\n```python \nfrom pytrovich.detector import PetrovichGenderDetector\n\ndetector = PetrovichGenderDetector()\nprint(detector.detect(firstname=\"Иван\"))  # Gender.MALE\nprint(detector.detect(firstname=\"Иван\", middlename=\"Семёнович\"))  # Gender.MALE\nprint(detector.detect(firstname=\"Арзу\", middlename=\"Лутфияр кызы\"))  # Gender.FEMALE\n```\n\n\n### Custom rule file\n\nYou can replace default rules file with some custom one. Only JSON format is supported.\n```python\nmaker = PetrovichDeclinationMaker(\"/path/to/custom/rules.file.json\")\n```\nE.g. if `pytrovich` fails on `PetrovichDeclinationMaker` creation, \none may consider downloading `rules.json` directly from \n[petrovich-rules repo](https://github.com/petrovich/petrovich-rules) as a fix (please create an issue if that actually happens).\n\n### How to cite\n\nNot neccessary, but greatly appreciated, if you use this work.\n\n```latex\n@misc{Pytrovich,\n  title     = {{petrovich/pytrovich: Python3 port of Petrovich, an inflector for Russian anthroponyms}},\n  year      = {2020},\n  url       = {https://github.com/petrovich/pytrovich},\n  language  = {english},\n}\n```\n\n### More info\n\nFor more information on the project please refer to other [petrovich](https://github.com/petrovich/) repos.\n\n### TODO\n\n- efficiency was not a top priority, the time has come for faster algorithms, RegEx and data structures\n- evaluation based on [petrovich-eval](https://github.com/petrovich/petrovich-eval/)\n\n## License\n\nThis project is available under MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetrovich%2Fpytrovich","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetrovich%2Fpytrovich","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetrovich%2Fpytrovich/lists"}