Installation
Install polytypo for JavaScript, Python, Go, Ruby or PHP and make a first call.
polytypo has one specification and five implementations. They are separate packages with the same behaviour for the same spec version: the same input, locale and options produce the same output in all of them.
| Runtime | Package | Source |
|---|---|---|
| JavaScript / TypeScript | polytypo on npm | polytypo-js |
| Python | polytypo on PyPI | polytypo-python |
| Go | polytypo-go on pkg.go.dev | polytypo-go |
| Ruby | polytypo on RubyGems | polytypo-ruby |
| PHP | polytypo/polytypo on Packagist | polytypo-php |
Install commands and the exact call shape for each language are on its runtime page: JavaScript, Python, Go, Ruby, PHP.
First call #
import { transform } from "polytypo";
transform('He said "wait..." -- twice.', { locale: "en-US" });
Input
Output
That is the whole shape: a string and a locale in, a string out. Anything else is an option on that call. Next:
- Pick the mode that matches what your string is.
- Pick the locale your text is written in.
- Read Options for what else a call can say.
Related #
- Choosing a mode
- transform
- Playground: run the engine in the browser