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.tag])

# 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

I know this is important. I will be working on automating this in a timely manner. Stay tuned! In the mean time, use the wiki as a first point of reference.

Get In Touch

You can reach me at dev.hentai-chan@outlook.com for private questions and inquires that don't belong to the issue tab.

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.2.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hentai-1.2-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

Details for the file hentai-1.2.tar.gz.

File metadata

  • Download URL: hentai-1.2.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.9

File hashes

Hashes for hentai-1.2.tar.gz
Algorithm Hash digest
SHA256 8fadd7d3e0ce8e0154d223ae978eb6db6f85b123edc705eac8405e2006e32035
MD5 da353b66e145a98d65086838b863aa4e
BLAKE2b-256 52793501ee7bca0b0fc74b3f53bacd00d4a5dca06425a76bdc63d91d0d417498

See more details on using hashes here.

File details

Details for the file hentai-1.2-py3-none-any.whl.

File metadata

  • Download URL: hentai-1.2-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.9

File hashes

Hashes for hentai-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8d4c627ac6ef0cf60b4bd2a374f340ee1dd8edb606d1f6456b3d37294ab592bf
MD5 3eefc6146ce138561bc923e76369f97c
BLAKE2b-256 88dc35d4198f0893fa5105d7ddfcac5dc0e4dbf482e42ff1e4c72cd51b43f7d0

See more details on using hashes here.

Supported by

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