b3yc0d3 / rule34Py

python api wrapper for rule34.xxx rest api
https://pypi.org/project/rule34Py/
GNU General Public License v3.0
24 stars 6 forks source link
adults-only api-client nsfw-api python-3 rule34-api rule34api rule34xxx
# rule34py ![GPL-3.0](https://img.shields.io/github/license/b3yc0d3/rule34Py) [![](https://img.shields.io/pypi/v/rule34Py)](https://pypi.org/project/rule34Py/) [![](https://img.shields.io/pypi/dm/rule34py?color=blue)](https://pypi.org/project/rule34Py/) Python api wrapper for [rule34.xxx](https://rule34.xxx/).

Getting Started

Install it using pip

pip install rule34py

Building it from Source

git clone https://github.com/b3yc0d3/rule34Py.git
cd rule34Py
python3 -m build

Documentation

You can find the documentation here.

[!NOTE] The documentation might move in the future.

Code Snippet

from rule34Py import rule34Py
r34Py = rule34Py()

# get comments of an post
r34Py.get_comments(4153825)

# get post by its id
r34Py.get_post(4153825)

# get top 100 icame
r34Py.icame()

# search for posts by tag(s)
r34Py.search(["neko"], page_id=2, limit=50)

# get pool by id
r34Py.get_pool(28)

# get a random post (in this case with tag(s))
random = r34Py.random_post(["neko"])

Development

Follow these steps to setup everything needed to develop on rule34Py.

Currently this setup guide only shows how it is done on unix-like systems.

Clone This Repository

git clone https://github.com/b3yc0d3/rule34Py.git

cd rule34Py

git checkout develop

Setting Up Virtual Python Environment

python -m venv venv

source venv/bin/activate

To deactivate the virtual environment type the following in your terminal

deactivate

Install and Build rule34Py in the Virtual Environment

python3 -m build

pip install -e .

Running the Test Suite

This project is tested by an organic pytest suite, stored under the :tests/ directory.

See the tests/README.md file for instructions on how to run the test suite.

Committing your Changes

Example structure of a commit message

here goes the title of the commit

Here goes the description

The title shall not be longer then 50 characters. Select the develop branch for pull requests.