Skip to main content

A Python utility for handling person names in a particular order, way, or shape.

Project description

namefully

PyPI version

A Python utility for handling person names.

Motivation

Have you ever had to format a user's name in a particular order, way, or shape? Probably yes. If not, it will come at some point. Be patient.

You may want to use this library if:

  • you've been repeatedly dealing with users' given names and surnames;
  • you need to occasionally format a name in a particular order, way, or shape;
  • you keep copy-pasting your name-related business logic for every project;
  • you're curious about trying new, cool stuff (e.g., learning Dart).

Key features

  1. Accept different data shapes as input
  2. Use optional parameters to access advanced features
  3. Format a name as desired
  4. Offer support for prefixes and suffixes
  5. Access to names' initials
  6. Support hyphenated names (and other special characters)
  7. Offer predefined validation rules for many writing systems, including the Latin and European ones (e.g., German, Greek, Cyrillic, Icelandic characters)

Advanced features

  1. Alter the name order anytime
  2. Handle various parts of a surname and a given name
  3. Use tokens (separators) to reshape prefixes and suffixes
  4. Accept customized parsers (do it yourself)
  5. Build a name on the fly (via a builder)
  6. Parse non-standard name cases

Installation

pip install namefully

Dependencies

None

Usage

from namefully import Namefully

name = Namefully('Thomas Alva Edison')
print(name.short)  # Thomas Edison
print(name.public)  # Thomas E
print(name.initials(with_mid=True))  # ['T', 'A', 'E']
print(name.format('L, f m'))  # EDISON, Thomas Alva
print(name.zip())  # Thomas A. E.

NOTE: if you intend to use this utility for non-standard name cases such as many middle names or last names, some extra work is required. For example, using Namefully.parse() lets you parse names containing many middle names with the risk of throwing a NameError when the parsing is not possible.

Contributing

Visit CONTRIBUTING.md for details on the contribution guidelines, the code of conduct, and the process for submitting pull requests.

License

The underlying content of this utility is licensed under MIT.

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

namefully-1.0.0a1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

namefully-1.0.0a1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file namefully-1.0.0a1.tar.gz.

File metadata

  • Download URL: namefully-1.0.0a1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.3

File hashes

Hashes for namefully-1.0.0a1.tar.gz
Algorithm Hash digest
SHA256 548bf8d9201c745fef3cb8d2ead73ba9d8f475366e7cc10d7c778e215a12d055
MD5 37fb665f332a3841040788e51509e70e
BLAKE2b-256 f759ed1587527a2b0b40a22b4e18a1b409fd5129697df0b5925c03b70dfe5bcd

See more details on using hashes here.

File details

Details for the file namefully-1.0.0a1-py3-none-any.whl.

File metadata

  • Download URL: namefully-1.0.0a1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.3

File hashes

Hashes for namefully-1.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 c6fa75d5194ff8822031643983001a0d2a300d2c1c25927c730f21fdcdabef9f
MD5 2d8c13baeafb7d19fce33fdf093a4aa3
BLAKE2b-256 4aeb38d5ddc8ec2cab122b965810245accc8632fb41ec8b8cd9fefc351263e46

See more details on using hashes here.

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