All Projects → hentai-chan → Hentai

hentai-chan / Hentai

Licence: gpl-3.0
Implements a wrapper class around nhentai's RESTful API.

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Hentai

Nanoidb
fun wrapper around IndexedDB
Stars: ✭ 44 (-35.29%)
Mutual labels:  wrapper
Retc
An application used to convert razer effects to multiple output sdks.
Stars: ✭ 54 (-20.59%)
Mutual labels:  wrapper
Rt Thread Wrapper Of Ucos Iii
RT-Thread操作系统的uCOS-III兼容层:让基于uC/OS-III操作系统开发的应用层无感地迁移到RT-Thread操作系统 | A wrapper which can make codes developed by uCOS-III APIs directly run on RT-Thread
Stars: ✭ 60 (-11.76%)
Mutual labels:  wrapper
Omdb Graphql Wrapper
🚀 GraphQL wrapper for the OMDb API
Stars: ✭ 45 (-33.82%)
Mutual labels:  wrapper
Mailjet Apiv3 Java
[API v3] Mailjet Java API Wrapper
Stars: ✭ 53 (-22.06%)
Mutual labels:  wrapper
Nodeactyl
A NodeJS API for Pterodactyl panel, this was originally designed for discord.js (Discord bots)
Stars: ✭ 55 (-19.12%)
Mutual labels:  wrapper
Node Prince
Node API for executing PrinceXML via prince(1) CLI
Stars: ✭ 42 (-38.24%)
Mutual labels:  wrapper
Domonit
A Deadly Simple Docker Monitoring Wrapper For Docker API
Stars: ✭ 67 (-1.47%)
Mutual labels:  wrapper
Pykcs11
PKCS#11 Wrapper for Python
Stars: ✭ 53 (-22.06%)
Mutual labels:  wrapper
Symphonyelectron
A desktop client for the Symphony Collaboration Platform built using Electron
Stars: ✭ 58 (-14.71%)
Mutual labels:  wrapper
Passfml
Pascal binding for SFML
Stars: ✭ 45 (-33.82%)
Mutual labels:  wrapper
Regex Builder
Write regular expressions in pure Java
Stars: ✭ 50 (-26.47%)
Mutual labels:  wrapper
Gwt Ol
GWT wrapper for OpenLayers 3+ using JSInterop
Stars: ✭ 57 (-16.18%)
Mutual labels:  wrapper
Genepi
Automatic generation of N-API wrapper from a C++ library
Stars: ✭ 45 (-33.82%)
Mutual labels:  wrapper
Vscode Surround
🔥A simple yet powerful extension to add wrapper templates around your code blocks
Stars: ✭ 60 (-11.76%)
Mutual labels:  wrapper
Termux Mpv
Wrapper for Mpv on Termux. Displays play controls in the notification
Stars: ✭ 43 (-36.76%)
Mutual labels:  wrapper
Objcxx
Stars: ✭ 54 (-20.59%)
Mutual labels:  wrapper
D2sqlite3
A small wrapper around SQLite for the D programming language
Stars: ✭ 67 (-1.47%)
Mutual labels:  wrapper
Remodel
Data and class remodeling library
Stars: ✭ 63 (-7.35%)
Mutual labels:  wrapper
Ws Wrapper
Lightweight WebSocket lib with socket.io-like event handling, requests, and channels
Stars: ✭ 58 (-14.71%)
Mutual labels:  wrapper

“De gustibus non est disputandum.”

Python Hentai API Wrapper

This python package implements a wrapper class around nhentai's RESTful API. Please be aware that this is not an official API, technical questions about nhentai.net should be redirected to [email protected]. Further note that the content of this module is generally considered NSFW. Finally, I would like to comment at this point that you should under no circumstances use this module to make an unreasonable amount of requests in a short period of time.

Installation

Get the most recent stable release from PyPI:

pip install hentai
Dev Notes for Contributors

Alternatively, if you're looking to make a contribution fork this repository and run

python -m venv venv/
source venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt
# additionally install the following dependencies
pip install flake8 pytest wheel
# run all unit tests
pytest --verbose
# create wheel
python setup.py bdist_wheel --universal

Make sure to checkout rec-hentai so that your work is up-to-date with the next release candidate. Don't implement any features that are incompatible with version 3.7+ of python.

Documentation

You can find the documentation online, or use the wiki to learn more about this module.

Basic Usage

Hentai makes it very easy to browse through nhentai.net. It implements a flat namespace for easy access of all their endpoints:

from hentai import Hentai, Format

doujin = Hentai(177013)

# True
Hentai.exists(doujin.id)

# METAMORPHOSIS
print(doujin.title(Format.Pretty))

# [Tag(id=3981, type='artist', name='shindol', url='https://nhentai.net/artist/shindol/', count=279)]
print(doujin.artist)

# ['dark skin', 'group', ... ]
print([tag.name for tag in doujin.tag])

# 2016-10-18 12:28:49+00:00
print(doujin.upload_date)

# ['https://i.nhentai.net/galleries/987560/1.jpg', ... ]
print(doujin.image_urls)

# get the source
doujin.download(progressbar=True)

Apart from that, hentai.Utils also provides a handful of miscellaneous helper methods:

from hentai import Utils, Sort, Option, Tag
from pathlib import Path

print(Utils.get_random_id())

# recommend me something good!
print(Utils.get_random_hentai())

# advanced search with queries
for doujin in Utils.search_by_query('tag:loli', sort=Sort.PopularWeek):
    print(doujin.title(Format.Pretty))

# print all character names from all doujins
for character in Tag.list(Option.Character):
    print(character.name)

# store custom meta data as JSON file to disk
popular_loli = Utils.search_by_query('tag:loli', sort=Sort.PopularWeek)
custom = [Option.ID, Option.Title, Option.Epos]
Utils.export(popular_loli, filename=Path('popular_loli.json'), options=custom)

See also https://nhentai.net/info/ for more information on search queries.

Command Line Interface

Starting with version 3.2.4, this module also provides a rudimentary CLI for downloading doujins within the terminal:

# get help
hentai -h

# download this doujin to the CWD
hentai -id 177013

# check the module version
hentai -version

Get In Touch

You can reach me at [email protected] for private questions and inquires that don't belong to the issue tab.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].