This repository contains miscellania, I've done or acquired over the years.
loc.php contains code (old as the world, of course), which can inflect Latvian nouns, given their nominative case in singular, and gender. It has its exceptions and shortcomings, but go ahead - fork it and throw a pull request at me.
Script pup.php converts Latvian text to so called "pupiņvaloda". It has simple rules, but helps children to train diction and thinking, since they have to know how to split a word into syllables and memorize last one on the go, to prepend it with "p".
conv.php provides dumb transliteration and detransliteration of Latvian text. It does try to keep capitalization intact while converting. Also, it has a list of some common exceptions ( sheema should become shēma, not šēma, etc).