Skip to main content

🔢 Simple universal word pluralizer 🔢

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plur-1.0.0.tar.gz (1.9 kB view hashes)

Uploaded Source

Built Distribution

plur-1.0.0-py3-none-any.whl (2.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page