Skip to main content

ISDN-Python

PyPI version Test

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

Metadata

Release files for isdn 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for isdn 2.0.0
File Size Uploaded
isdn-2.0.0.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for isdn 2.0.0
File Interpreter ABI Platform
isdn-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.0 kB

Release files / isdn-2.0.0.tar.gz

Download URL isdn-2.0.0.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8bfbc1c5d0ccafc12e6989972774b4bb46e04793ae9400aaff513382ff0b0685
BLAKE2b-256 checksum
How to use checksums
f0e4a85ed7e2884ef60969ac2f9ee9152779af86cdad017ce6c81702e1595a52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.1 CPython/3.11.0 Linux/6.11.0-1018-azure

Release files / isdn-2.0.0-py3-none-any.whl

Download URL isdn-2.0.0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
90da2d686d7cebe59289b77685028b874dc0d7f9b6092b17865ec968d6d3bb06
BLAKE2b-256 checksum
How to use checksums
03a285ef05e3ca41efb58848b9209e36108af09daf4681819c5968d7e0766b63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.1 CPython/3.11.0 Linux/6.11.0-1018-azure

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page