Skip to content
/ plur Public

🔢 Simple universal word pluralizer 🔢

Notifications You must be signed in to change notification settings

rec/plur

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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))

About

🔢 Simple universal word pluralizer 🔢

Resources

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages