A Python utility for handling person names in a particular order, way, or shape.
Project description
namefully
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
- Accept different data shapes as input
- Use optional parameters to access advanced features
- Format a name as desired
- Offer support for prefixes and suffixes
- Access to names' initials
- Support hyphenated names (and other special characters)
- Offer predefined validation rules for many writing systems, including the Latin and European ones (e.g., German, Greek, Cyrillic, Icelandic characters)
Advanced features
- Alter the name order anytime
- Handle various parts of a surname and a given name
- Use tokens (separators) to reshape prefixes and suffixes
- Accept customized parsers (do it yourself)
- Build a name on the fly (via a builder)
- 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 aNameError
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
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
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 548bf8d9201c745fef3cb8d2ead73ba9d8f475366e7cc10d7c778e215a12d055 |
|
MD5 | 37fb665f332a3841040788e51509e70e |
|
BLAKE2b-256 | f759ed1587527a2b0b40a22b4e18a1b409fd5129697df0b5925c03b70dfe5bcd |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6fa75d5194ff8822031643983001a0d2a300d2c1c25927c730f21fdcdabef9f |
|
MD5 | 2d8c13baeafb7d19fce33fdf093a4aa3 |
|
BLAKE2b-256 | 4aeb38d5ddc8ec2cab122b965810245accc8632fb41ec8b8cd9fefc351263e46 |