Skip to main content

Library for ISDN (International Standard Dojin Numbering)

Project description

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
'みほん同人誌'

CLI

指定したISDNの形式を検証

$ isdn validate 2784702901978

指定したISDNの書誌情報を isdn.jp から取得

$ isdn get 2784702901978
$ isdn get 2784702901978 --format json

ISDNの一覧を isdn.jp から取得

$ isdn list

すべての書誌情報を isdn.jp から取得してファイルに保存

$ isdn bulk-download /path/to/download

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-1.0.1.tar.gz (5.7 kB view hashes)

Uploaded Source

Built Distribution

isdn-1.0.1-py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page