Metadata-Version: 2.1
Name: isdn
Version: 1.0.1
Summary: Library for ISDN (International Standard Dojin Numbering)
Home-page: https://github.com/Babibubebon/isdn-python
License: MIT
Keywords: book,doujinshi,identifier
Author: Babibubebon
Author-email: babibubebon@babibubebo.org
Requires-Python: >=3.10,<4.0
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: click (>=8.1.3,<9.0.0)
Requires-Dist: lxml (>=4.9.2,<5.0.0)
Requires-Dist: requests (>=2.28.2,<3.0.0)
Project-URL: Repository, https://github.com/Babibubebon/isdn-python
Description-Content-Type: text/markdown

# ISDN-Python

[![PyPI version](https://badge.fury.io/py/isdn.svg)](https://badge.fury.io/py/isdn)
[![Test](https://github.com/Babibubebon/isdn-python/actions/workflows/test.yml/badge.svg)](https://github.com/Babibubebon/isdn-python/actions/workflows/test.yml)

[ISDN (International Standard Dojin Numbering)](https://isdn.jp/) のPythonライブラリとCLIツール

## Install

```
$ pip install isdn
```

## Example

ISDNを[番号の仕様](https://isdn.jp/about.html)に従って検証

```python
>>> from isdn import ISDN
>>> isdn = ISDN("2784702901978")
>>> isdn.validate()
True
>>> ISDN.calc_check_digit("2784702901978")
'8'
```

isdn.jp が提供している書誌情報を取得 ([Web からの情報取得](https://isdn.jp/about.html))

```python
>>> 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
```

