https://github.com/rec/plur
🔢 Simple universal word pluralizer 🔢
https://github.com/rec/plur
Last synced: 12 months ago
JSON representation
🔢 Simple universal word pluralizer 🔢
- Host: GitHub
- URL: https://github.com/rec/plur
- Owner: rec
- Created: 2022-11-23T15:18:02.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-14T14:43:41.000Z (over 2 years ago)
- Last Synced: 2025-07-04T06:06:50.103Z (12 months ago)
- Language: Python
- Homepage:
- Size: 43 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: FUNDING.yml
Awesome Lists containing this project
README
# plur: 🔢 simple universal word pluralizer 🔢
Tired of seeing `1 branch(es) deleted`?
Sick of
es = '' if len(branches) == 1 else 'es'
print(f'{len(branches) branch{es} created')
or even worse?
Try `plur` for your tiny pluralization needs:
import plur
print(plur('branch', '-es'), branches), 'created)
* No dictionary file!
* No dependencies!
* No salesperson will call!
Examples:
import plur
dogs = ['fido', 'rover']
print(plur('dog', dogs)) # prints: 2 dogs
dogs.pop()
print(plur('dog', dogs)) # prints: 1 dog
dogs.pop()
print(plur('dog', dogs)) # prints: 0 dogs
# Great for f-strings
dogs = 'fido', 'rover'
print(f'Today we have {plur("dog", dogs)}')
For words you use a lot, you can defer operation:
dog = plur('dog')
cat = plur('cat')
ox = plur('ox', '-en')
print(dog(dogs), 'live in my house with', ox(ox_list))