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
'みほん同人誌'
>>> record
ISDNRecord(
    isdn=ISDN(
        code='2784702901978',
        prefix='278',
        group='4',
        registrant='702901',
        publication='97',
        check_digit='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=[
        UserOption(property='執筆者', value='みほん執筆者1'),
        UserOption(property='執筆者', value='みほん執筆者2'),
        UserOption(property='執筆者', value='みほん執筆者3'),
        UserOption(property='執筆者', value='みほん執筆者4'),
        UserOption(property='執筆者', value='みほん執筆者5'),
        UserOption(property='執筆者', value='みほん執筆者6')
    ],
    external_links=[
        ExternalLink(title='国際標準同人誌番号', uri=HttpUrl('http://isdn.jp/', )),
        ExternalLink(
            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 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-1.1.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

isdn-1.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file isdn-1.1.0.tar.gz.

File metadata

  • Download URL: isdn-1.1.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.11.0 Linux/5.15.0-1035-azure

File hashes

Hashes for isdn-1.1.0.tar.gz
Algorithm Hash digest
SHA256 8cb17c02982e0e355aa7bec7b61a93c3ecc895a2eff845046c3cbaa4f2f73754
MD5 3f26d29f91833b56e5c2b2846f73bf6f
BLAKE2b-256 acaeba681690baed2977d769420862c4136f35eb7c6be59a816cae454139cdef

See more details on using hashes here.

File details

Details for the file isdn-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: isdn-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.11.0 Linux/5.15.0-1035-azure

File hashes

Hashes for isdn-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79c67911330c5529e58802d117c6a0a18a53dad33bf9139b8f4b1dfcabf9dd11
MD5 f74525d11649890ad70c203adbc6fe76
BLAKE2b-256 017cefb5c4eb2fd564dd477ce3e54acd0dbfa03f0bc832f9340508bc2f7e1508

See more details on using hashes here.

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