Token导航 LogoToken导航TokenDH.com
Py Nameplate logo
运维云端stdio官方级别未说明来源级核验

Py Nameplate

MCP Server

一个用于将非结构化的美国联系人字符串解析为结构化组件的Python库、MCP服务器和REST API。

工具数

2

提示词数

0

GitHub Stars

0

资源数

0
PythonClaude批量处理Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

dannyheskett

提供方

dannyheskett

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install py-nameplate

详细介绍

py-nameplate

![CI](https://github.com/dannyheskett/py-nameplate/actions/workflows/ci.yml) Python 3.12+ License

A Python library, MCP server, and REST API for parsing unstructured US contact strings into structured components.

The Problem

You have messy contact data:

Dr. John Smith Jr. 742 Evergreen Terrace
JANE DOE 123 MAIN ST APT 2B BOSTON MA 02101
Smith, Robert "Bob" 456 Oak Ave, Chicago, IL 60601

You need structured data you can actually use.

The Solution

One function that handles it all:

from nameplate import parse

result = parse("Dr. John Smith Jr. 742 Evergreen Terrace, Springfield, IL 62701")

# Name components
result.name.prefix      # "Dr."
result.name.first       # "John"
result.name.last        # "Smith"
result.name.suffix      # "Jr."

# Address components
result.address.street_number  # "742"
result.address.street_name    # "Evergreen"
result.address.street_type    # "Terrace"
result.address.city           # "Springfield"
result.address.state          # "IL"

result.input_type       # "contact"
result.validated        # True (city/state in database)

How It Works

The parse() function uses token-based segmentation to automatically find the boundary between name and address:

Dr. John Smith Jr. 742 Evergreen Terrace
└───── name ─────┘ └────── address ─────┘

Segmentation algorithm:

  1. Tokenize input into words
  2. Scan for first numeric token that isn't a name suffix (III, 1ST, etc.)
  3. Verify remaining tokens contain street indicators (St, Ave, ZIP, state, etc.)
  4. Split at that boundary

Address parsing works backwards from the end:

  • Extract ZIP code (5 or 9 digits)
  • Extract state (2-letter code)
  • Extract city (validated against database)
  • Extract unit (Apt, Suite, #)
  • Remaining tokens are street components

Street-based enhancement fills in missing city/state:

  • If address has a street but no city, look up the street in the database
  • If street exists in exactly one location, auto-fill city and state
  • Common streets like "Main Street" exist in many cities and won't enhance

Installation

pip install py-nameplate

Or with uv:

uv add py-nameplate

Usage

Basic Parsing

from nameplate import parse

# Auto-detects input type
result = parse("123 Main St, Boston, MA 02101")
result.input_type  # "address"

result = parse("Dr. Jane Doe")
result.input_type  # "name"

result = parse("John Smith 123 Main St, Boston, MA 02101")
result.input_type  # "contact"

Enhancement

# Without enhancement - street alone has no city/state
result = parse("100 Dunwoody Club Dr")
result.address.city   # ""
result.address.state  # ""

# With enhancement - city/state auto-filled if street is unique in database
result = parse("100 Dunwoody Club Dr", enhance=True)
result.address.city   # "Atlanta" (auto-filled)
result.address.state  # "GA" (auto-filled)
result.enhanced       # True

Normalization

# Smart title case
result = parse("PATRICK O'BRIEN 123 MAIN ST", normalize=True)
result.name.last       # "O'Brien" (not "O'brien")
result.address.city    # "Boston" (not "BOSTON")

result = parse("RONALD MCDONALD", normalize=True)
result.name.last  # "McDonald" (not "Mcdonald")

Batch Processing

from nameplate import parse_batch

texts = [
    "Dr. John Smith",
    "123 Main St, Boston, MA 02101",
    "Jane Doe 456 Oak Ave, Chicago, IL 60601",
]
result = parse_batch(texts, enhance=True)
result.total           # 3
result.parsed_count    # 3
result.enhanced_count  # number with enhanced data

Supported Formats

Names

FormatExample
SimpleJohn Smith
With prefixDr. Jane Doe, Lt. Col. John Smith
With suffixJohn Smith Jr., Jane Doe PhD
Last, FirstSmith, John
With nicknameRobert "Bob" Smith
Name particlesLudwig van Beethoven, Juan de la Vega
Roman numeralsHenry Ford III

Addresses

FormatExample
Standard123 Main St, Boston, MA 02101
With unit456 Oak Ave Apt 2B, Chicago, IL 60601
PO BoxPO Box 789, Miami, FL 33101
Directional100 N Main St, Denver, CO 80202
ZIP+4123 Main St, Boston, MA 02101-1234

Contacts

Any combination of name followed by address:

John Smith 123 Main St, Boston, MA 02101
Dr. Jane Doe Jr. PO Box 456, Seattle, WA 98101

MCP Server

Use with Claude Desktop or Claude.ai as an MCP tool.

Local (uvx)

Add to ~/.claude/claude_desktop_config.json:

{
  "mcpServers": {
    "nameplate": {
      "command": "uvx",
      "args": ["nameplate"]
    }
  }
}

Hosted

{
  "mcpServers": {
    "nameplate": {
      "type": "url",
      "url": "https://nameplate.mcp.danheskett.com/"
    }
  }
}

Available Tools

ToolDescription
parseParse any input with auto-detection and optional enhancement
parse_batchBatch parse multiple inputs

Example Prompts

"Parse this: Dr. John Smith 742 Evergreen Terrace, Springfield, IL"
"Parse with enhancement: Jane Doe 100 Dunwoody Club Dr"
"Parse these contacts: John Smith, 123 Main St Boston MA, Jane Doe 456 Oak Ave Chicago IL"

REST API

Use the REST API for direct HTTP access without MCP.

Base URL: https://nameplate.mcp.danheskett.com

Endpoints

EndpointMethodDescription
/api/parsePOSTParse a single input
/api/parse/batchPOSTParse multiple inputs
/healthGETHealth check

Request Format

{
  "text": "Dr. John Smith 123 Main St, Boston, MA 02101",
  "normalize": false,
  "enhance": false
}

For batch requests, use texts (array) instead of text:

{
  "texts": ["John Smith", "123 Main St, Boston, MA 02101"],
  "normalize": true,
  "enhance": true
}

Examples

Basic parse:

curl -X POST https://nameplate.mcp.danheskett.com/api/parse \
  -H "Content-Type: application/json" \
  -d '{"text": "Dr. John Smith 123 Main St, Boston, MA 02101"}'

Parse with enhancement:

curl -X POST https://nameplate.mcp.danheskett.com/api/parse \
  -H "Content-Type: application/json" \
  -d '{"text": "Jane Doe 100 Dunwoody Club Dr", "enhance": true}'

Batch parsing:

curl -X POST https://nameplate.mcp.danheskett.com/api/parse/batch \
  -H "Content-Type: application/json" \
  -d '{"texts": ["John Smith", "123 Main St, Boston, MA 02101"], "normalize": true}'

Health check:

curl https://nameplate.mcp.danheskett.com/health

Python API Reference

parse(text, normalize=False, enhance=False) -> ParseOutput

ParameterTypeDescription
textstrInput string to parse
normalizeboolApply smart title case
enhanceboolFill in missing data from database

ParseOutput

FieldTypeDescription
input_typestr"name", "address", or "contact"
nameNameOutputParsed name components
addressAddressOutputParsed address components
parsedboolTrue if parsing succeeded
validatedboolTrue if city/state found in database
enhancedboolTrue if data was enhanced
enhanced_fieldslist[str]Fields that were enhanced
errorslist[str]Any parsing errors

NameOutput

FieldTypeDescription
prefixstrDr., Mr., Mrs., Rev., etc.
firststrFirst/given name
middlestrMiddle name(s)
laststrLast/family name
suffixstrJr., Sr., III, PhD, etc.
nicknamestrNickname if present

AddressOutput

FieldTypeDescription
street_numberstrHouse/building number
street_namestrStreet name
street_typestrSt, Ave, Blvd, etc.
street_directionstrN, S, E, W, etc.
unit_typestrApt, Suite, Unit, etc.
unit_numberstrUnit/apartment number
citystrCity name
statestrTwo-letter state code
zip_codestr5 or 9 digit ZIP

Data Sources

Development

git clone https://github.com/dannyheskett/py-nameplate.git
cd py-nameplate
uv sync --extra dev

# Run tests
uv run pytest

# Lint
uv run ruff check src/ tests/
uv run ruff format src/ tests/

Privacy

The hosted MCP server does not store, log, or retain any data. All parsing happens in memory. See the source code to verify.

License

BSD-3-Clause

目录标签

目录标签

PythonClaude批量处理联系人解析本地部署地址解析姓名解析数据标准化

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

token

工具数量(toolCount,工具数)

2

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiotoken部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP