Skip to main content

DMM Web API v3.0 for Python3

Project description

# dmm_search3
[![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat)](https://github.com/0x0u/dmm/blob/master/LICENSE.txt)
[![Build Status](https://travis-ci.org/0x0u/dmm_search3.svg?branch=master)](https://travis-ci.org/0x0u/dmm_search3)
[![Requirements Status](https://requires.io/github/0x0u/dmm_search3/requirements.svg?branch=master)](https://requires.io/github/0x0u/dmm_search3/requirements/?branch=master)

[DMM Webサービス](https://affiliate.dmm.com/api/)をPythonで扱うためのライブラリです。

[コチラ](https://affiliate.dmm.com/api/regist_guide/)からアカウントを作成して、API IDとアフィリエイトIDを取得しておく必要があります。

## Install
pipでインストールします。
```
pip3 install dmm_search3
```

## Usage
モジュールのインポート
```Python
from dmm import DMM
```

取得したAPI IDとアフィリエイトIDを下記変数に代入
```Python
api_id = 'your_api_id'
affiliate_id = 'your_affiliate_id'
```

インスタンスの作成
```Python
dmm = DMM(api_id=api_id, affiliate_id=affiliate_id)
```

商品検索メソッド
```Python
item = dmm.item_search(keyword='バレンタイン')
for i in item:
print(i)
```

メソッドは商品(item)、女優(actress)、ジャンル(genre)、メーカー
(maker)、シリーズ(series)、作者(author)検索があります。

```Python
dmm.<対象>_search(引数)
```

引数は([APIリファレンス](https://affiliate.dmm.com/api/v3/itemlist.html))のリクエストパラメータを指定します。原則としてhits(データの取得件数)、offset(検索開始位置)、output(出力形式)はそれぞれ最大値である100、最小値である1、jsonでデフォルト引数として指定しています。

引数に値を渡す場合は明示的にキーワードを指定します。

```Python
dmm.item_search(keyword='バレンタイン', hits=5, offset=10, sort='review')
```

## License
MIT
https://github.com/0x0u/dmm_search3/blob/master/LICENSE.txt

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

dmm_search3-0.2.tar.gz (3.8 kB view details)

Uploaded Source

File details

Details for the file dmm_search3-0.2.tar.gz.

File metadata

  • Download URL: dmm_search3-0.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/38.5.1 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.6.2

File hashes

Hashes for dmm_search3-0.2.tar.gz
Algorithm Hash digest
SHA256 40a44339c58ed0528edac10a910e4d25ef849e71f92cfc0142d1118ef1ef2936
MD5 3e491acc072188a349de2a53732a5c73
BLAKE2b-256 090de5c01948d0159808b63925e030181ee89f87709487afc511a0c3c85df552

See more details on using hashes here.

Supported by

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