-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
50 lines (42 loc) · 10.5 KB
/
setup.py
File metadata and controls
50 lines (42 loc) · 10.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# coding: utf-8
"""
Jikan API
[Jikan](https://jikan.moe) is an **Unofficial** MyAnimeList API. It scrapes the website to satisfy the need for a complete API - which MyAnimeList lacks. # Information ⚡ Jikan is powered by its awesome backers - 🙏 [Become a backer](https://www.patreon.com/jikan) ## Rate Limiting | Duration | Requests | |----|----| | Daily | **Unlimited** | | Per Minute | 60 requests | | Per Second | 3 requests | Note: It's still possible to get rate limited from MyAnimeList.net instead. ## JSON Notes - Any property (except arrays or objects) whose value does not exist or is undetermined, will be `null`. - Any array or object property whose value does not exist or is undetermined, will be empty. - Any `score` property whose value does not exist or is undetermined, will be `0`. - All dates and timestamps are returned in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format and in UTC timezone ## Caching By **CACHING**, we refer to the data parsed from MyAnimeList which is stored temporarily on our servers to provide better API performance. All requests are cached for **24 hours**. The following response headers will detail cache information. | Header | Remarks | | ---- | ---- | | `Expires` | Cache expiry date | | `Last-Modified` | Cache set date | | `X-Request-Fingerprint` | Unique request fingerprint (only for cachable requests, not queries) | Note: `X-Request-Fingerprint` will only be available on single resource requests and their child endpoints. e.g `/anime/1`, `/anime/1/relations`. They won't be available on pages which perform queries, like /anime, or /top/anime, etc. ## Allowed HTTP(s) requests **Jikan REST API does not provide authenticated requests for MyAnimeList.** This means you can not use it to update your anime/manga list. Only GET requests are supported which return READ-ONLY data. ## HTTP Responses All error responses are accompanied by a JSON Error response. | Exception | HTTP Status | Remarks | | ---- | ---- | ---- | | N/A | `200 - OK` | The request was successful | | N/A | `304 - Not Modified` | You have the latest data (Cache Validation response) | | `BadRequestException`,`ValidationException` | `400 - Bad Request` | You've made an invalid request. Recheck documentation | | `BadResponseException` | `404 - Not Found` | The resource was not found or MyAnimeList responded with a `404` | | `BadRequestException` | `405 - Method Not Allowed` | Requested Method is not supported for resource. Only `GET` requests are allowed | | `RateLimitException` | `429 - Too Many Request` | You are being rate limited by Jikan or MyAnimeList is rate-limiting our servers (specified in the error response) | | `UpstreamException`,`ParserException`,etc. | `500 - Internal Server Error` | Something didn't work. Try again later. If you see an error response with a `report_url` URL, please click on it to open an auto-generated GitHub issue | | `ServiceUnavailableException` | `503 - Service Unavailable` | In most cases this is intentionally done if the service is down for maintenance. | ## JSON Error Response ```json { \"status\": 500, \"type\": \"InternalException\", \"message\": \"Exception Message\", \"error\": \"Exception Trace\", \"report_url\": \"https://github.com...\" } ``` | Property | Remarks | | ---- | ---- | | `status` | Returned HTTP Status Code | | `type` | Thrown Exception | | `message` | Human-readable error message | | `error` | Error response and trace from the API | | `report_url` | Clicking this would redirect you to a generated GitHub issue | ## Cache Validation - All requests return a `ETag` header which is an MD5 hash of the response - You can use this hash to verify if there's new or updated content by suppliying it as the value for the `If-None-Match` in your next request header - You will get a HTTP `304 - Not Modified` response if the content has not changed - If the content has changed, you'll get a HTTP `200 - OK` response with the updated JSON response  ## Disclaimer - Jikan is not affiliated with MyAnimeList.net. - Jikan is a free, open-source API. Please use it responsibly. ---- By using the API, you are agreeing to Jikan's [terms of use](https://jikan.moe/terms) policy. [v3 Documentation](https://jikan.docs.apiary.io/) - [Wrappers/SDKs](https://github.com/jikan-me/jikan#wrappers) - [Report an issue](https://github.com/jikan-me/jikan-rest/issues/new) - [Host your own server](https://github.com/jikan-me/jikan-rest)
The version of the OpenAPI document: 4.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from setuptools import setup, find_packages # noqa: H301
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
NAME = "jikan-openapi"
VERSION = "4.0.0"
PYTHON_REQUIRES = ">=3.7"
REQUIRES = [
"urllib3 >= 1.25.3, < 2.1.0",
"python-dateutil",
"pydantic >= 2",
"typing-extensions >= 4.7.1",
]
setup(
name=NAME,
version=VERSION,
description="Jikan API",
author="API Support (Discord)",
author_email="team@openapitools.org",
url="",
keywords=["OpenAPI", "OpenAPI-Generator", "Jikan API"],
install_requires=REQUIRES,
packages=find_packages(exclude=["test", "tests"]),
include_package_data=True,
license="MIT",
long_description_content_type='text/markdown',
long_description="""\
[Jikan](https://jikan.moe) is an **Unofficial** MyAnimeList API. It scrapes the website to satisfy the need for a complete API - which MyAnimeList lacks. # Information ⚡ Jikan is powered by its awesome backers - 🙏 [Become a backer](https://www.patreon.com/jikan) ## Rate Limiting | Duration | Requests | |----|----| | Daily | **Unlimited** | | Per Minute | 60 requests | | Per Second | 3 requests | Note: It's still possible to get rate limited from MyAnimeList.net instead. ## JSON Notes - Any property (except arrays or objects) whose value does not exist or is undetermined, will be `null`. - Any array or object property whose value does not exist or is undetermined, will be empty. - Any `score` property whose value does not exist or is undetermined, will be `0`. - All dates and timestamps are returned in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format and in UTC timezone ## Caching By **CACHING**, we refer to the data parsed from MyAnimeList which is stored temporarily on our servers to provide better API performance. All requests are cached for **24 hours**. The following response headers will detail cache information. | Header | Remarks | | ---- | ---- | | `Expires` | Cache expiry date | | `Last-Modified` | Cache set date | | `X-Request-Fingerprint` | Unique request fingerprint (only for cachable requests, not queries) | Note: `X-Request-Fingerprint` will only be available on single resource requests and their child endpoints. e.g `/anime/1`, `/anime/1/relations`. They won't be available on pages which perform queries, like /anime, or /top/anime, etc. ## Allowed HTTP(s) requests **Jikan REST API does not provide authenticated requests for MyAnimeList.** This means you can not use it to update your anime/manga list. Only GET requests are supported which return READ-ONLY data. ## HTTP Responses All error responses are accompanied by a JSON Error response. | Exception | HTTP Status | Remarks | | ---- | ---- | ---- | | N/A | `200 - OK` | The request was successful | | N/A | `304 - Not Modified` | You have the latest data (Cache Validation response) | | `BadRequestException`,`ValidationException` | `400 - Bad Request` | You've made an invalid request. Recheck documentation | | `BadResponseException` | `404 - Not Found` | The resource was not found or MyAnimeList responded with a `404` | | `BadRequestException` | `405 - Method Not Allowed` | Requested Method is not supported for resource. Only `GET` requests are allowed | | `RateLimitException` | `429 - Too Many Request` | You are being rate limited by Jikan or MyAnimeList is rate-limiting our servers (specified in the error response) | | `UpstreamException`,`ParserException`,etc. | `500 - Internal Server Error` | Something didn't work. Try again later. If you see an error response with a `report_url` URL, please click on it to open an auto-generated GitHub issue | | `ServiceUnavailableException` | `503 - Service Unavailable` | In most cases this is intentionally done if the service is down for maintenance. | ## JSON Error Response ```json { \"status\": 500, \"type\": \"InternalException\", \"message\": \"Exception Message\", \"error\": \"Exception Trace\", \"report_url\": \"https://github.com...\" } ``` | Property | Remarks | | ---- | ---- | | `status` | Returned HTTP Status Code | | `type` | Thrown Exception | | `message` | Human-readable error message | | `error` | Error response and trace from the API | | `report_url` | Clicking this would redirect you to a generated GitHub issue | ## Cache Validation - All requests return a `ETag` header which is an MD5 hash of the response - You can use this hash to verify if there's new or updated content by suppliying it as the value for the `If-None-Match` in your next request header - You will get a HTTP `304 - Not Modified` response if the content has not changed - If the content has changed, you'll get a HTTP `200 - OK` response with the updated JSON response  ## Disclaimer - Jikan is not affiliated with MyAnimeList.net. - Jikan is a free, open-source API. Please use it responsibly. ---- By using the API, you are agreeing to Jikan's [terms of use](https://jikan.moe/terms) policy. [v3 Documentation](https://jikan.docs.apiary.io/) - [Wrappers/SDKs](https://github.com/jikan-me/jikan#wrappers) - [Report an issue](https://github.com/jikan-me/jikan-rest/issues/new) - [Host your own server](https://github.com/jikan-me/jikan-rest)
""", # noqa: E501
package_data={"jikan_openapi": ["py.typed"]},
)