Python logo

Deklinacija

A Python library for grammatically correct declension (Serbian: deklinacija) of personal first and last names in Serbian, with support for both Cyrillic and Latin scripts, and even creation of possessive forms. Try out this web demo:



Nominative

Genitive

Dative

Accusative

Vocative

Instrumental

Locative

Possessive

Singular

Plural

Male

Female

Neutral

JSON API

You can easily integrate this functionality into your app by sending a POST request using the URL format below. All you have to specify is the name and the gender of the person. Valid parameters for gender are "male" and "female". Please note that this website is hosted on PythonAnywhere's free tier and thus this API should not be used in production.

https://deklinacija.pythonanywhere.com/api/<name>/<gender>

Example:

https://deklinacija.pythonanywhere.com/api/Stefan/male

Returns:

{ "akuzativ": "Stefana", "dativ": "Stefanu", "genitiv": "Stefana", "instrumental": "Stefanom", "lokativ": "Stefanu", "nominativ": "Stefan", "vokativ": "Stefane" }

For possessive form:

https://deklinacija.pythonanywhere.com/api/possessive/Stefan/male

Returns:

{ "female_plural": "Stefanove", "female_singular": "Stefanova", "male_plural": "Stefanovi", "male_singular": "Stefanov", "name": "Stefan", "neutral_plural": "Stefanova", "neutral_singular": "Stefanovo" }