semvec/pypi-packages huggingface dataset:
dmm-search3 2.3
DMM Web API Version 3.0 Wrapper for Python3
License: MIT
Keywords: python3,dmm,REST API

# dmm-search3

[![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat)](https://github.com/miya/dmm_search3/blob/master/LICENSE.txt)
![](https://github.com/miya/dmm_search3/workflows/workflow/badge.svg)

DMM Web API Version 3.0 Wrapper for Python3

## Requirements
Please get it [here](https://affiliate.dmm.com/api/guide/).

* api_id
* affiliate_id

## Install  
```
$ pip3 install dmm-search3
```

## Initialize
```python
# モジュールのインポート
import dmm

# API ID と アフィリエイトIDをセット
api_id = "your_api_id"
affiliate_id = "your_affiliate_id"

# インスタンスの作成
api = dmm.API(api_id=api_id, affiliate_id=affiliate_id)
```

## Feature
```python
#商品検索
item_search = api.item_search(site="FANZA", hits=1, keyword="バレンタイン")

#フロア一覧
floor_list = api.floor_list()

#女優検索
actress_search = api.actress_search()

#ジャンル検索
genre_search = api.genre_search(floor_id=91)

#メーカー検索
maker_search = api.maker_search(floor_id=91)

#シリーズ検索
series_search = api.series_search(floor_id=91)

#作者検索
author_search = api.author_search(floor_id=91)

# サンプル動画ドウンロード
dmm.sample_download(content_id="abgktk_0012", file_name="sample", size="big")
```

## Sample
Please refer [here](https://github.com/miya/dmm_search3/blob/master/test.py).
aiomysql-core 0.0.9
Simple framework for aiomysql
License: MIT



## Aiomysql-Core

### Simple framework for aiomysql

## Introduce

simple package, easy to use

[aiomysql](https://github.com/aio-libs/aiomysql)

## Document

[click me](https://aiomysql-core.readthedocs.io)

## Installation
```linux
pip install aiomysql-core
```

## Simple uses
```python
import asyncio
import aiomysql
from aiomysql_core import AioMysqlCore


async def test_example(loop):
    pool = await aiomysql.create_pool(host='', port=3306,
                                      user='', password='',
                                      db='', loop=loop)
    core = AioMysqlCore(pool=pool)
    rows = await core.query('select * from users where uid=%s', 113)
    print(rows)
    rows = await core.gener('select * from users limit 100')
    async for row in rows:
        print(row)
    row = await core.get('select * from users where uid=%(uid)s', {'uid': 113})
    print(row)
    rowcount = await core.execute_rowcount('select * from users where uid=%(uid)s', {'uid': 113})
    print(rowcount)
    pool.close()
    await pool.wait_closed()


loop = asyncio.get_event_loop()
loop.run_until_complete(test_example(loop))
```

## Simple SQLAlchemy uses
```python
import asyncio
from aiomysql.sa import create_engine
from aiomysql_core import AioMysqlAlchemyCore
from sqlalchemy import Column, Integer, String, MetaData, Table

metadata = MetaData()

Test = Table('test', metadata,
             Column('id', Integer, primary_key=True),
             Column('content', String(255), server_default="")
             )


async def test_example(loop):
    config = {'user': '', 'password': '', 'db': '',
              'host': '', 'port': 3306, 'autocommit': True, 'charset': 'utf8mb4'}
    engine = await create_engine(loop=loop, **config)
    core = AioMysqlAlchemyCore(engine=engine)
    # insert
    doc = {'content': 'insert'}
    clause = Test.insert().values(**doc)
    rowcount = await core.execute_rowcount(clause)
    print(rowcount)
    # search
    clause = Test.select().where(Test.c.id == 1).limit(1)
    row = await core.get(clause)
    print(row.id, row.content)
    clause = Test.select().where(Test.c.id > 1)
    rows = await core.query(clause)
    async for row in rows:
        print(row.id, row.content)
    # update
    doc = {'content': 'update'}
    clause = Test.update().values(**doc).where(Test.c.id == 1)
    rowcount = await core.execute_rowcount(clause)
    print(rowcount)
    # delete
    clause = Test.delete().where(Test.c.id == 1)
    rowcount = await core.execute_rowcount(clause)
    print(rowcount)
    await engine.wait_closed()


loop = asyncio.get_event_loop()
loop.run_until_complete(test_example(loop))
```