Library for ISDN (International Standard Dojin Numbering)
Project description
ISDN-Python
ISDN (International Standard Dojin Numbering) のPythonライブラリとCLIツール
Install
$ pip install isdn
Example
ISDNを番号の仕様に従って検証
>>> from isdn import ISDN
>>> isdn = ISDN("2784702901978")
>>> isdn.validate()
True
>>> ISDN.calc_check_digit("2784702901978")
'8'
isdn.jp が提供している書誌情報を取得 (Web からの情報取得)
>>> from isdn import ISDNClient
>>> client = ISDNClient()
>>> record = client.get("2784702901978")
>>> record.isdn
ISDN(code='2784702901978', prefix='278', group='4', registrant='702901', publication='97', check_digit='8')
>>> record.product_name
'みほん同人誌'
>>> from pprint import pprint
>>> pprint(record.model_dump(), sort_dicts=False)
{'disp_isdn': 'ISDN278-4-702901-97-8',
'region': '日本',
'class_': 'オリジナル',
'type': '同人誌',
'rating_gender': '区別なし',
'rating_age': '一般',
'product_name': 'みほん同人誌',
'product_yomi': 'みほんどうじんし',
'publisher_code': '14142139',
'publisher_name': '見本サークル',
'publisher_yomi': 'みほんさーくる',
'issue_date': datetime.date(2008, 3, 12),
'genre_code': '106',
'genre_name': '評論・情報',
'genre_user': None,
'c_code': 'C3055',
'author': '専門',
'shape': '単行本',
'contents': '電子通信',
'price': Decimal('100'),
'price_unit': 'JPY',
'barcode2': '2923055001007',
'product_comment': None,
'product_style': None,
'product_size': None,
'product_capacity': None,
'product_capacity_unit': None,
'sample_image_uri': HttpUrl('https://isdn.jp/images/thumbs/2784702901978.png'),
'useroptions': [{'property': '執筆者', 'value': 'みほん執筆者1'},
{'property': '執筆者', 'value': 'みほん執筆者2'},
{'property': '執筆者', 'value': 'みほん執筆者3'},
{'property': '執筆者', 'value': 'みほん執筆者4'},
{'property': '執筆者', 'value': 'みほん執筆者5'},
{'property': '執筆者', 'value': 'みほん執筆者6'}],
'external_links': [{'title': '国際標準同人誌番号', 'uri': HttpUrl('http://isdn.jp/')},
{'title': 'mixiコミュニティ',
'uri': HttpUrl('http://mixi.jp/view_community.pl?id=3188828')}]}
CLI
指定したISDNの形式を検証
$ isdn validate 2784702901978
指定したISDNの書誌情報を isdn.jp から取得
$ isdn get 2784702901978
$ isdn get 2784702901978 --format dict
$ isdn get 2784702901978 --format json
ISDNの一覧を isdn.jp から取得
$ isdn list
すべての書誌情報を isdn.jp から取得してファイルに保存
$ isdn bulk-download /path/to/download
$ isdn bulk-download /path/to/download --write-image
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
isdn-2.0.0.tar.gz
(6.8 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
isdn-2.0.0-py3-none-any.whl
(8.3 kB
view details)
File details
Details for the file isdn-2.0.0.tar.gz.
File metadata
- Download URL: isdn-2.0.0.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.11.0 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bfbc1c5d0ccafc12e6989972774b4bb46e04793ae9400aaff513382ff0b0685
|
|
| MD5 |
138cb04fde1087c60e60fa5dbd373a4c
|
|
| BLAKE2b-256 |
f0e4a85ed7e2884ef60969ac2f9ee9152779af86cdad017ce6c81702e1595a52
|
File details
Details for the file isdn-2.0.0-py3-none-any.whl.
File metadata
- Download URL: isdn-2.0.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.11.0 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90da2d686d7cebe59289b77685028b874dc0d7f9b6092b17865ec968d6d3bb06
|
|
| MD5 |
b72b0334a7a10313d16871eb14658fe9
|
|
| BLAKE2b-256 |
03a285ef05e3ca41efb58848b9209e36108af09daf4681819c5968d7e0766b63
|