Metadata-Version: 2.4
Name: larzphone
Version: 0.1.0
Summary: Parse, validate and format phone numbers to E.164 - offline, zero dependencies
Author: larz-scripter
License: MIT
Project-URL: Homepage, https://github.com/larz-scripter/larzphone
Project-URL: Repository, https://github.com/larz-scripter/larzphone
Project-URL: Issues, https://github.com/larz-scripter/larzphone/issues
Keywords: phone,phonenumber,e164,telephone,validation,libphonenumber,zero-dependency,pure-python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# larzphone

**Parse, validate and format phone numbers to E.164 — offline, zero dependencies.**

A practical, libphonenumber-style helper without the multi-megabyte metadata or
any dependency. Parse a messy number into its country and national parts,
validate its length, and format it as E.164, international or national — all
from a compact built-in table covering the major calling regions.

## Install

```bash
pip install larzphone
```

## Use

```python
from larzphone import parse, is_valid, format_e164

n = parse("+1 (415) 555-2671")
n.region, n.country_code, n.national_number   # 'US', '1', '4155552671'
n.e164()                                       # '+14155552671'  (store this)
n.international()                               # '+1 415 555 2671'

parse("0803 123 4567", region="NG").e164()     # '+2348031234567'
is_valid("+44 20 7946 0958")                    # True
is_valid("+1415555")                            # False (too short for US)
```

E.164 is the one format you should persist — `parse(...).e164()` normalizes any
input (spaces, dashes, parens, `00`/`+` prefixes) to it.

## Tests

```bash
python -m unittest discover -s tests -v   # 19 tests
```

## The Larz stack

One of 60+ pure-Python, zero-dependency libraries at
[github.com/larz-scripter](https://github.com/larz-scripter). Handy alongside
[larzvalidate](https://github.com/larz-scripter/larzvalidate) for form input.

## License

MIT (c) larz-scripter
