S
smisk

inflection

New in version 1.1.0.

Word transformation. Transforms words from singular to plural, class names to table names, modularized class names to ones without, and class names to foreign keys.

Inflection is language specific and the default inflection handles English language inflection. You can access inflection handlers for other languages by importing the appropriate inflector. For example from miwa.inflection.sv import inflection to use Swedish inflection.

AuthorRasmus Andersson — http://hunch.se/
var inflectionslocale-to-Inflection-object map
var inflectionEnglish inflection (default)

Modules

Classes

class smisk.inflection.Inflector(*locales)

Language inflector. Encapsulates all rules for pluralizing and singularizing words in a given locale.

Variable localeslanguages this inflection handles
Variable pluralsplural rules
Variable singularssingular rules
Variable uncountableslist of uncountable words
pluralize(word)
Parametersword (str)
Return typestr

Return the plural form of word.

singularize(word)
Parametersword (str)
Return typestr

Return the singular form of word.

camelize(word)

Convert underscored_word to CamelCase.

underscore(word)

Convert CamelCase to underscored_lower_case.

tableize(class_name)

Create the table name for a given class name.

foreign_key(class_name)

Create a foreign key name from a class name.