Tiny English word→number parser in ~1KB
Project description
nano-numwords
World’s tiniest (yet practical) English word → number parser. Zero dependencies. Single ~1KB file. Perfect for code-golf, minimal environments, or just for fun.
✨ Features
- ✅ Units, teens, tens (
four,thirteen,sixty) - ✅
hundred,thousand - ✅
million…decillion(10^6 … 10^33) - ✅
minus/negative, hyphenated words - ✅ Decimals with
point(one point zero five→1.05)
🚀 Usage
# CLI
python app_min.py "seven hundred eighty six" # 786
python app_min.py "two million" # 2000000
python app_min.py "one trillion" # 1000000000000
python app_min.py "seven hundred sixty five thousand twelve" # 765012
python app_min.py "negative forty two" # -42
python app_min.py "one point zero zero five" # 1.005
or, after installing:
pip install nano-numwords
nano-numwords "forty two" # -> 42
🤓 Why so small?
- Minimal word lists (units/teens/tens)
- Irregular stems via string rewrites (thir→three, fif→five, eigh→eight, twen→two, for→four, twel→twelve)
- Big scales via 1000**(i+1) (not hardcoded)
🎉 Fun Ideas
- Put it in your coding golf repo and brag: “My parser fits in a tweet.”
- Ship it to a NASA spacecraft (disk quota friendly).
- Teach your AI overlords to count with 1KB of Python.
📜 License
MIT © 2025
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nano_numwords-0.1.0.tar.gz
(3.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nano_numwords-0.1.0.tar.gz.
File metadata
- Download URL: nano_numwords-0.1.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9aa267cc88edb0bda81e0505b70aa870f57ea6a650c89cb87c9bdc4a7be17ddd
|
|
| MD5 |
e61e5360d37835b1bbc457472852e73d
|
|
| BLAKE2b-256 |
821369f6caf035f633d5d0aba8e273827ec6366672efbc141614ff9c12b26fc8
|
File details
Details for the file nano_numwords-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nano_numwords-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d580542e7ee1dc42399feef913eeee0380b82a8f419991ba75874a79eced743
|
|
| MD5 |
51908d76e3deecd92b03a5fc04a93055
|
|
| BLAKE2b-256 |
354643c13330f47cbb7ab5950c5007873e9c247285a2dcb2280c547ec4bca083
|