Japanese Telephone Number Utility
Project description
jptel は日本の電話番号を市外局番・市内局番・加入者番号に分割して返します。
This package is utility for japaneses telephone number.
インストール
$ pip install jptel
使い方
>>> import jptel
>>> jptel.normalize('0123456789')
'0123-45-6789'
>>> jptel.normalize('0123456789')
'0123-45-6789'
>>> jptel.validate('0123456789')
True
>>> jptel.validate('022252-2222')
False
>>> jptel.split('0312345678')
{'area_code': '03', 'city_code': '1234', 'subscriber_code': '5678'}
>>> jptel.split('00000000000')
exception.InvalidTelephoneNumberException
その他
固定電話の市外局番データは総務省のサイトからダウンロードできるExcelから生成しています。 再生成する場合は以下の手順で行って下さい。
$ pip install -r dev_requirements.txt $ python _generate_master_data.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jptel-0.1.2.tar.gz
(5.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
jptel-0.1.2-py3-none-any.whl
(7.8 kB
view details)
File details
Details for the file jptel-0.1.2.tar.gz.
File metadata
- Download URL: jptel-0.1.2.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e08a1c98f3881ce15ec873eb6f547c04df9cb12fdc11c6a98c0b1de5ab08a87
|
|
| MD5 |
51d3006c81f9dcf6654d0ec0d8ca4d7d
|
|
| BLAKE2b-256 |
ec160d09c5d2734d6874fdb16f732076946aad3f37d11f3664e48b0b2ba29684
|
File details
Details for the file jptel-0.1.2-py3-none-any.whl.
File metadata
- Download URL: jptel-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c953ee34c461efc72e77459fdc5f409294ebc2bf471b08b0c646b8d174430979
|
|
| MD5 |
7198dbb35ea48501792c5f6dac7fe6ed
|
|
| BLAKE2b-256 |
6d573c71f92de1b77103214e7a45c9ffc4a4987cdf23617342e2a2d03b4deab2
|