Skip to main content

Nyahentai Python API made using webscraping.

Project description

Nyahentai API

A Nyahentai API made using python webscrapping For update notes follow me on Twitter.

Instalation

 pip install --upgrade Nyahentai-API
 # or pip3 install --upgrade Nyahentai-API

Library Features

  • Home page pagination,
  • Doujin information,
  • Random doujin,
  • Search by id and tag,
  • Character List

Usage

Home
from nyahentai import Nyahentai

if __name__ == '__main__':
    nyahentai = Nyahentai()
    random_doujin: HomePage = nyahentai.get_pages(page=1)

the expected output is a HomePage instance:

    HomePage(
        doujins: [
            DoujinThumbnail(
                id: str, 
                title: str, 
                lang: str, 
                cover: str, 
                data_tags: List[str])], 
        total_pages: int)
Random
from nyahentai import Nyahentai

if __name__ == '__main__':
    nyahentai = Nyahentai()
    random_doujin: Doujin = nyahentai.get_random()

The expected output is a Doujin instance:

    Doujin(
        id: str
        title: str
        secondary_title: str
        tags: List[str]
        artists: List[str]
        languages: List[str]
        categories: List[str]
        characters: List[str]
        parodies: List[str]
        groups: List[str]
        images: List[str]
        total_pages: int)

It's good always remember that some doujins doesnt have many properties that are listed above like artists, characters, parodies and more. This is only the default Doujin dataclass template.

Search
from nyahentai import Nyahentai

if __name__ == '__main__':
    nyahentai = Nyahentai()
    search_obj: SearchPage = nyahentai.search(query='naruto', sort='popular', page=1)
    search_obj: SearchPage = nyahentai.search(query='30955', sort='popular', page=1)

expected output:

    SearchPage(
        query: str, 
        sort: str, 
        total_results: int, 
        doujins: [
            DoujinThumbnail(
                id: str, 
                title: str, 
                lang: str, 
                cover: str, 
                data_tags: List[str])], 
        total_pages: int)
Doujin
from nyahentai import Nyahentai

if __name__ == '__main__':
    nyahentai = Nyahentai()
    doujin: Doujin = nyahentai._get_doujin(id='287167')

expected output:

    Doujin(
        id: str
        title: str
        secondary_title: str
        tags: List[str]
        artists: List[str]
        languages: List[str]
        categories: List[str]
        characters: List[str]
        parodies: List[str]
        groups: List[str]
        images: List[str]
        total_pages: int)
Characters
from nyahentai import Nyahentai

if __name__ == '__main__':
    nyahentai = Nyahentai()
    doujin: Doujin = nyahentai.get_characters(page=1)

expected output:

    CharacterListPage(
                    page=int,
                    total_pages=int,
                    characters=[
                        CharacterLink(
                            section: str
                            title: str
                            url: str
                            total_entries: int)])

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

Nyahentai-API-1.0.0.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

Nyahentai_API-1.0.0-py3-none-any.whl (6.5 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