Skip to content

cerebruminc/types-nameparser

Repository files navigation

types-nameparser

PyPI version Python versions

Typing stubs for the nameparser library.

Overview

This package provides type information (stub files) for the nameparser library, enabling better IDE support and static type checking when working with human name parsing functionality.

The nameparser library is a Python library for parsing human names into their component parts (first name, last name, middle name, title, suffix, etc.), but it doesn't include type hints. This package fills that gap by providing comprehensive type stubs.

Installation

pip install types-nameparser

Or if you're using uv:

uv add types-nameparser

Usage

After installation, you can use the type stubs with your existing nameparser code:

from nameparser import HumanName

# Now you get full type hints and IDE support!
name = HumanName("Dr. John Michael Smith Jr.")
print(name.first)    # "John"
print(name.last)     # "Smith" 
print(name.middle)   # "Michael"
print(name.title)    # "Dr."
print(name.suffix)   # "Jr."

Type Information

The stubs provide type information for the HumanName class with the following properties:

  • first: str - First name component
  • last: str - Last name component
  • middle: str - Middle name component
  • title: str - Title component (Mr., Mrs., Dr., etc.)
  • suffix: str - Suffix component (Jr., Sr., III, etc.)
  • nickname: str - Nickname component

Development

This project uses uv for dependency management and just for task running.

Setup

# Install dependencies
just install

Available Commands

# Run linting
just lint

# Run linting with auto-fix
just lint-fix

# Format code
just format

# Type checking
just type-check

# Run tests
just test

# Run tests with coverage
just test-cov

Requirements

  • Python 3.10+
  • The actual nameparser library (this package only provides type stubs)

License

This project is licensed under the same terms as the original nameparser library.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Related Projects

  • nameparser - The original name parsing library
  • typeshed - Collection of type stubs for Python standard library and third-party packages

About

Python types stub for the nameparser module

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •