Skip to main content

"Implements a wrapper class around nhentai's RESTful API."

Project description

Python Hentai API Wrapper

This python package implements a wrapper class around nhentai's RESTful API. Note that the content of this module is generally considered NSFW.

Installation

Get the most recent stable release from PyPI:

pip install hentai

Basic Usage

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

from hentai import Hentai, Format

doujin = Hentai(177013)

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

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

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

# 2016-10-18 14:28:49
print(doujin.upload_date)

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

Apart from that, Hentai also provides a handful of miscellaneous static methods:

from hentai import Sort

# recommend me something good!
random_id = Hentai.get_random_id()

# format defaults to 'English'
print(Hentai(random_id).title())

# advanced search with queries
for doujin in Hentai.search_by_query('tag:loli', sort=Sort.PopularWeek):
    print(Hentai.get_title(doujin))

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

Documentation

Follows soon.

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

hentai-1.1.tar.gz (17.7 kB view hashes)

Uploaded Source

Built Distribution

hentai-1.1-py3-none-any.whl (17.6 kB view hashes)

Uploaded Python 3

Supported by

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