A small Python toolkit for analyzing and transforming text, usable as a library or from the command line.
games/iron-assault/ holds a browser run-and-gun game in the style of classic arcade
side-scrollers. Open games/iron-assault/index.html in a browser; nothing needs to be
built or installed. Graphics are painted procedurally on a canvas, and all sound effects,
music and announcer lines are generated in the browser (Web Audio + Speech Synthesis).
- 5 missions + Boss Rush: jungle, desert ruins, snowy peak, a ruined city at night and the enemy HQ. Each has its own scenery, weather, music and boss (heavy tank, mechanical scorpion, gunship, bipedal mech, fortress).
- 4 difficulty levels (新兵 / 老兵 / 精英 / 地狱) that change lives, health, enemy fire rate, bullet speed, enemy density, boss health and score multiplier.
- Weapons: pistol, heavy machine gun, homing rockets, flame shot, shotgun, laser, grenades and a melee knife. Rescue prisoners for supplies.
- Controls: keyboard (arrows/WASD, J fire, K jump, L grenade, P pause), gamepad, and on-screen touch controls on phones.
git clone https://github.com/lelegaga/test.git
cd test
pip install -e .$ textkit stats "Hello world. How are you?"
characters: 25
words: 5
lines: 1
sentences: 2
average_word_length: 3.8
$ echo "the cat and the dog and the bird" | textkit top -n 2
3 the
2 and
$ textkit slug "Hello World!"
hello-world
$ textkit palindrome "A man, a plan, a canal: Panama"
yesYou can also run it as python -m textkit.
from textkit import analyze, slugify, top_words
analyze("Hello world.").words # 2
slugify("Café au lait") # "cafe-au-lait"
top_words("a b a c a", n=1) # [("a", 3)].
├── src/textkit/ # Package source
│ ├── core.py # Text utilities
│ └── cli.py # Command-line interface
├── tests/ # pytest test suite
├── .github/ # CI workflow, issue and PR templates
├── assets/ # Images, including the animated crocodile SVG
├── games/iron-assault/ # Browser run-and-gun game (HTML5 canvas, no build step)
├── pyproject.toml # Package metadata and tool config
├── CHANGELOG.md
├── CONTRIBUTING.md
└── LICENSE
See CONTRIBUTING.md.