phonenumbers-jp-py
Get attribute information from Japanese domestic phone numbers.
日本国内の電話番号から、種別や市外局番などの情報を取得します。
License: MIT
Installation
pip3 install phonenumbers-jp -U
Examples
>>> phonenumbers_jp.parse("0311111111")
NumberInfo(parts=['03', '1111', '1111'], type='固定', subtype=None, message_area=NumberAndName(number='03', name='東京'), specified_carrier=None, callerid_delivery=None)
>>> phonenumbers_jp.parse("0992000000")
NumberInfo(parts=['099', '200', '0000'], type='固定', subtype=None, message_area=NumberAndName(number='099', name='鹿児島'), specified_carrier=None, callerid_delivery=None)
>>> phonenumbers_jp.parse("1840992000000")
NumberInfo(parts=['184', '099', '200', '0000'], type='固定', subtype=None, message_area=NumberAndName(number='099', name='鹿児島'), specified_carrier=None, callerid_delivery='withhold')
>>> phonenumbers_jp.parse("09011112222")
NumberInfo(parts=['090', '1111', '2222'], type='携帯', subtype=None, message_area=None, specified_carrier=None, callerid_delivery=None)
>>> phonenumbers_jp.parse("117")
NumberInfo(parts=['117'], type='特番', subtype='時報', message_area=None, specified_carrier=None, callerid_delivery=None)
>>> phonenumbers_jp.parse("05012345678")
NumberInfo(parts=['050', '1234', '5678'], type='IP', subtype=None, message_area=None, specified_carrier=None, callerid_delivery=None)
>>> phonenumbers_jp.parse("00630111111111")
NumberInfo(parts=['0063', '011', '111', '1111'], type='固定', subtype=None, message_area=NumberAndName(number='011', name='札幌'), specified_carrier=NumberAndName(number='0063', name='ソフトバンク株式会社'), callerid_delivery=None)
>>> phonenumbers_jp.parse("0120444444")
NumberInfo(parts=['0120', '444', '444'], type='フリーダイヤル', subtype=None, message_area=None, specified_carrier=None, callerid_delivery=None)
API
NumberTypes = Literal[
"特番", "固定", "携帯", "IP", "M2M", "国際電話", "国外",
"フリーダイヤル", "FMC", "ポケベル", "災害募金サービス", "ナビダイヤル"
]
@dataclass
class NumberAndName:
number: str
name: str
@dataclass
class NumberInfo:
parts: List[str] = field(default_factory=list) # 分解された電話番号
type: Optional[NumberTypes] = None # 種別
subtype: Optional[str] = None # 特番の内容
message_area: Optional[NumberAndName] = None # メッセージエリア (市外局番)
specified_carrier: Optional[NumberAndName] = None # 事業者指定番号
callerid_delivery: Optional[Literal["withhold", "provide"]] = None # 非通知・通知
def parse(number: str) -> NumberInfo:
...
Metadata
Release files for phonenumbers-jp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| phonenumbers_jp-0.1.0.tar.gz | 16.0 kB | Without provenance | Details for phonenumbers_jp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| phonenumbers_jp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for phonenumbers_jp-0.1.0-py3-none-any.whl |
Total release size: 32.1 kB
Release files / phonenumbers_jp-0.1.0.tar.gz
| Download URL | phonenumbers_jp-0.1.0.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a8efc67f9a984ec257f44c6048711dfd259d1792f9bc22952cce3240bc57c59
|
|
BLAKE2b-256 checksum How to use checksums |
41717f6c5081acf4424b3501781fd68a418dc3366365308337ae5a83da13b448
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.11.1 Darwin/22.1.0
|
Release files / phonenumbers_jp-0.1.0-py3-none-any.whl
| Download URL | phonenumbers_jp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 16.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3aac49481f1ca6c38ef35f267cd8c31e7332ae28ee8c4c794fa34df555dc6f46
|
|
BLAKE2b-256 checksum How to use checksums |
dd8a958c374524eba8f4a2ed08504b391c942466e2ad3f1aaeffc49a82e4d19d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.11.1 Darwin/22.1.0
|
Security for phonenumbers-jp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.