Skip to content

Capabilities

A capability is one kind of identifier Paxman knows how to canonicalize. Each capability is a self-contained package — its own patterns, its own specifications, its own rendering — that plugs into the shared pipeline.

You pick a capability by picking a contract (see Contracts). The two are paired: Email.create_contract() selects the Email capability, Country.create_contract() selects Country, and so on.


  1. Each capability has a lowercase name (e.g. "email", "country", "url").
  2. Its contract carries that name in capability_name.
  3. paxman.canonicalize(text, contract) looks up the capability by that name in the registry.
  4. Only that capability’s grammars and rules run for the call — other capabilities’ grammars never see the input. (With register_all_shipped() every shipped capability is loaded; with register_capability(Email()) only Email is.)

This keeps imports cheap: from paxman.capabilities import Email loads only Email, not every capability.


  • Notation — internal shape (not part of the public API).
  • Grammars — recognizers that scan your text and emit span-bearing matches. Pure syntax — no spec judgment.
  • Rules — validators that check each match against an authoritative spec (RFC, ISO standard, etc.) and produce a canonical value plus provenance.
  • Contract — the user-facing configuration (see Contracts).
  • format_value — the sole rendering step, controlled by output_format on the contract.

You never interact with notations, grammars, or rules directly — you configure them through the contract and read their outcome in the result.


The set below reflects the current release and is intentionally not presented as a final count. New capabilities are added in minor releases — always check paxman.capabilities or the release notes for the latest list.

CapabilityWhat it canonicalizesKey formats it recognizesCanonical form you get back
CountryCountry codes and namesalpha-2, alpha-3, numeric, names; optional localized (CLDR) and historical namesalpha-2 code ("US"), or other form via output_format
CurrencyCurrency identifiers (no amounts)ISO 4217 alpha-3 codes, CLDR symbols and display namesuppercase alpha-3 code ("USD")
DateCalendar datesISO 8601, slash-ISO, US, EuropeanISO YYYY-MM-DD by default
EmailEmail addressesstandard, obfuscated (user at domain dot com), localhostlowercased addr-spec
IPIP addressesIPv4, IPv6 (optionally disabled)normalized address (IPv6 per RFC 5952)
ISBNISBN identifiersISBN-13 and ISBN-10 (legacy → ISBN-13)bare 13-digit form or hyphenated
MoneyMoney amounts with currencycodes, symbols, or names adjacent to an amountCODE amount padded to minor units
PhonePhone numbersE.164, tel-URI, 00-prefix international, NANP nationalE.164 (+15551234567) or other via output_format
SI UnitSI unit expressionssymbols, names, product/quotient compoundscanonical symbol form ("kg", "m/s2")
URLAbsolute URIs / IRIsabsolute URIs (WHATWG URL Standard)WHATWG serialization (lowercased host, etc.)
BICBusiness identifier codes (ISO 9362)8/11-character codesbic form
CoordinatesWGS 84 coordinatesdecimal pairs, DMS, Geo URI, ISO 6709, GeoJSONlat-first signed decimal degrees
ChemicalElementChemical elements (IUPAC)symbols, names, labeled atomic numbersproper-case symbol ("Fe")
IBANBank account numbers (ISO 13616)electronic compact, paper groups-of-four, labelscompact electronic form
ISSNSerial identifiers (ISO 3297)hyphenated, compact, labelshyphenated ("0317-8471")
LanguageLanguage identifiers (BCP 47)tags, codes, namesbcp47 tag
MacAddressMAC addresses (IEEE 802)colon/hyphen/dot groupscolon form
ORCIDResearcher identifiers (ISO 27729)hyphenated, compact, URIshyphenated orcid form
TimezoneTime zone identifiers (IANA TZDB 2026d)zone keys, legacy Links, fixed zones, SystemV namesIANA key ("America/New_York"); opted-in SystemV names keep their fixed-rule key ("EST5EDT")
UtcOffsetUTC offset values (ISO 8601-1)prefixed/bare offsets, Zextended +HH:MM ("+05:30")
UUIDUUIDs (IETF RFC 9562)hyphenated, bare hex, braced, URN carrierslowercase hyphenated ("6ba7b810-9dad-11d1-80b4-00c04fd430c8")
DOIDigital object identifiers (ISO 26324)bare names, resolver URLs, doi: labels, urn:doi:/info:doi/ carriersbare lowercase 10. name ("10.1038/nature12345")
ISINSecurities identification numbers (ISO 6166)compact 12-char codes, single-space groupings, ISIN labelscompact uppercase ("US0378331005")
ISNIPublic-identity identifiers (ISO 27729)spaced quads, compact, hyphenated, ISNI labels, isni.org URIs, urn:isni: carriersspaced display ("0000 0001 2103 2683")
LEILegal entity identifiers (ISO 17442)compact 20-char codes, single-space forms, LEI labels, urn:lei: carrierscompact uppercase ("5493000IBP32UQZ0KL24")
GTINTrade item identifiers (GS1)compact 8/12/13/14 runs, zero-padded 14-digit fields, space/hyphen groupings, GTIN/UPC/EAN labels, (01)/AI 01 markers14-digit zero-padded ("00614141999996"); native offers the spelled length
CreditCardPayment card numbers (ISO/IEC 7812-1)compact 12–19-digit runs, space/hyphen groupings (4-4-4-4, 4-6-5, 14-digit), PAN labelscontiguous digits ("4111111111111111"); grouped offers groups-of-four
DomainHostnames (RFC 1034/1035, UTS #46, RFC 5893, IANA Root Zone)bare FQDNs any case, root dots, U-labels, ACE labels, fullwidth/dot variants, embedded mentionslowercase A-label ("xn--mnchen-3ya.de"); unicode offers the U-label rendering
UNSPSCProduct/service codes (UNDP UNSPSC)bare 8-digit, zero-padded parents, 6-digit aliases, UNSPSC labels, UNSPSC000. MDM IDs, 10-digit +BFI8-digit wire stem ("44103103"); labeled/native offered
MinorPlanetMinor-planet designations (MPC)unpacked provisionals, packed 7-char, extended _, surveys both spellings, parenthesized and packed numbersunpacked canonical ("1995 XA"); packed offered

This table is an overview. Each capability’s contract documents its specific flags (e.g. include_localized for Country, default_country for Phone). See Contracts and the README examples for per-capability details; each row is expanded into its own guide under Capabilities.


Before the first canonicalize() call, register:

import paxman
from paxman.capabilities import Email, Country
# Option A — everything shipped in this release
paxman.register_all_shipped()
# Option B — explicit, dependency-clear
paxman.register_capability(Email())
paxman.register_capability(Country())
  • Registration must complete from a single thread before the first call.
  • After the first call the registry freezes — further register_* calls raise CapabilityError. Reads from any thread are then safe.

Think of a capability like a department that handles one kind of paperwork. The Country department knows passports and country codes; the Email department knows addresses. You hand your paper to the right department by handing it a contract stamped with that department’s name. Only that department looks at it. Other departments never see it.

Next: Contracts → — how to configure what the chosen capability does.