Skip to main content

Doujinshi.org unofficial wrapper of official API

Project description

DoujinAPI2-py

Doujinshi.org unofficial wrapper of official API

Requirements

Usage

(TODO: publish on pypi)
import asyncio
from doujinApi import DoujinApi

# You can get api key from doujinshi.org easily.
client = DoujinApi("INPUT_YOUR_API_KEY")

async def main():
    searchResult = await client.searchBookByName("魔法少女は深淵になにをみるか?")
    return searchResult

books = asyncio.run(main())
print(books)

# And you'll get below
[Book(
    id='B868487',
    name_jp='魔法少女は深淵になにをみるか?',
    name_en=None,
    name_r=None,
    authors=[Author(
        id='A109490',
        name_jp='彩電',
        name_en=None,
        name_r='None',
        name_alt=[],
        count=47
    )],
    circles=[Circle(
        id='C69210',
        name_jp='こねこぼたん',
        name_en=None,
        name_r='コネコボタン',
        name_alt=[],
        count=41,
        authors=[]
    )],
    parodies=[Parody(
        id='P4828',
        name_jp='ご注文はうさぎですか?',
        name_en='Is the Order a Rabbit?',
        name_r='ゴチュウモンハウサギデスカ',
        name_alt=['Gochūmon wa Usagi Desu ka?',
        'gochuumon wa usagi desu ka'],
        count=1944,
        contents=[],
        characters=[]
    )],
    characters=[
        Character(
            id='H23212',
            name_jp='香風智乃',
            name_en='Kafuu Chino',
            name_r='カフウチノ',
            name_alt=['チノ'],
            count=576,
            sex=<Sex.FEMALE: 2>,
            age=13,
            contents=[]
        ),
        Character(
            id='H23211',
            name_jp='保登心愛',
            name_en='Hoto Kokoa',
            name_r='ホトココア',
            name_alt=[
                'ココア',
                'Cocoa'
            ],
            count=400,
            sex=<Sex.FEMALE: 2>,
            age=None,
            contents=[],
        )
    ],
    contents=[Content(
            name_jp='不詳',
            name_en='Unknown',
            name_r=None,
            count=1601292,
    )],
    date_released=datetime.date(2015, 12, 29),
    event=Convention(
        id='N2386',
        name_jp='コミックマーケット 89',
        name_en='Comic Market 89',
        name_r='コミックマーケット89',
        name_alt=['コミックマーケット89'],
        count=16268,
        date_start=datetime.date(2015,12,29),
        date_end=datetime.date(2015,12,31)
    ),
    image='https://img.doujinshi.org/big/434/868487.jpg',
    url='https://www.doujinshi.org/book/868487',
    pages=28,
    nsfw=False,
    anthology=False,
    copyshi=False,
    magazine=False,
    isbn=None,
    language=<Language.JAPANESE: 3>
)]

# And you can parse the book as filename
filename = client.parseBookAsFilename(books[0])
print(filename)

# And you'll see below
(C89) [こねこぼたん (彩電)] 魔法少女は深淵になにをみるか? (ご注文はうさぎですか?)

# Also you can search book by image
async def main2():
    resp = await client.searchBookByImage("RELATIVE_PATH_TO_IMAGE")
    return resp

Note

Doujinshi.org API is really complex for me. Please make an issue if something is wrong.

This is rechallenge after 5 years past. Does this code looks better than before? XD

Sometimes doujinshi.org server goes down, but don't worry, the server will come back soon :v

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

doujinApi-0.1.0.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

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

doujinApi-0.1.0-py3-none-any.whl (40.5 kB view details)

Uploaded Python 3

File details

Details for the file doujinApi-0.1.0.tar.gz.

File metadata

  • Download URL: doujinApi-0.1.0.tar.gz
  • Upload date:
  • Size: 23.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.8.6 Windows/10

File hashes

Hashes for doujinApi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5502039283f2027192855463bccea6d37e5e11a193aa7595ce1324019862ab8c
MD5 f205602a56f76e89441fb981184d8357
BLAKE2b-256 cbb4d77710e4d740298a841757dc1b023a50efa0df700fce7aab48ee6064db7e

See more details on using hashes here.

File details

Details for the file doujinApi-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: doujinApi-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 40.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.8.6 Windows/10

File hashes

Hashes for doujinApi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 992e9003137ec4ca28dcdb8207aae7929cf5afed48765298d6cacba5b7e82314
MD5 65a5bccf11ab79b4bbc3b37e0fad565f
BLAKE2b-256 3b7f670d7072ed9e70c88e311f2c54a4ea9b8063a1af7d2ffc3b4dc5e9e3711e

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