syam585 / Yippi

An (a)sync e621 API wrapper library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overview

https://travis-ci.org/rorre/Yippi.svg?branch=master

https://img.shields.io/pypi/pyversions/Yippi

https://img.shields.io/github/license/rorre/Yippi https://img.shields.io/pypi/v/yippi

GitHub issues

An (a)sync e621 API wrapper library.

  • Free software: GNU Lesser General Public License v3 (LGPLv3)

Installation

pip install yippi

You can also install the in-development version with:

pip install git+ssh://git@github.com/rorre/yippi.git@master

Quickstart

Sync

>>> import requests
>>> from yippi import YippiClient
>>>
>>> session = requests.Session()
>>> client = YippiClient("MyProject", "1.0", "MyUsernameOnE621", session)
>>> posts = client.posts("m/m zeta-haru rating:s") # or ["m/m", "zeta-haru", "rating-s"], both works.
[Post(id=1383235), Post(id=514753), Post(id=514638), Post(id=356347), Post(id=355044)]
>>> posts[0].tags
{'artist': ['zeta-haru'],
 'character': ['daniel_segja', 'joel_mustard'],
 'copyright': ['patreon'],
 'general': ['5_fingers', ..., 'spooning'],
 'invalid': [],
 'lore': [],
 'meta': ['comic'],
 'species': ['bird_dog', ... ]}

Async

>>> import aiohttp
>>> from yippi import AsyncYippiClient
>>>
>>> session = aiohttp.ClientSession()
>>> client = AsyncYippiClient("MyProject", "1.0", "MyUsernameOnE621", session)
>>> posts = await client.posts("m/m zeta-haru rating:s") # or ["m/m", "zeta-haru", "rating-s"], both works.
[Post(id=1383235), Post(id=514753), Post(id=514638), Post(id=356347), Post(id=355044)]
>>> posts[0].tags
{'artist': ['zeta-haru'],
 'character': ['daniel_segja', 'joel_mustard'],
 'copyright': ['patreon'],
 'general': ['5_fingers', ..., 'spooning'],
 'invalid': [],
 'lore': [],
 'meta': ['comic'],
 'species': ['bird_dog', ... ]}

Documentation

Documentation is available on readthedocs: https://yippi.readthedocs.io/

Development

To run the all tests run:

tox

Note, to combine the coverage data from all the tox environments run:

Windows
set PYTEST_ADDOPTS=--cov-append
tox
Other
PYTEST_ADDOPTS=--cov-append tox

About

An (a)sync e621 API wrapper library.

License:GNU General Public License v3.0


Languages

Language:Python 100.0%