A python wrapper for the mangadex API V5. It uses the requests library and all the aditional arguments can be viewed in the Official Mangadex Documentation
sh
pip install --Upgrade mangadex
sh
python setup.py install --user
```py
import mangadex api = mangadex.Api() ```
This is called mangalist in the documentation
```py
manga_list = api.get_manga_list(limit = 1) #limits the query to return just one manga manga_list[Manga(manga_id = 0001183c-2089-48e9-96b7-d48db5f1a611, title = {'en': 'Eight'}, altTitles = [{'ja': '8οΌγ¨γ€γοΌ'}], description = {'en': 'Tokyo in the 90s, the city center has been suffering from a continuing depopulation. Also affected is the Udagawa Junior High School where only six people are left, as their class leader, protector and very good friend Masato just died in an illegal skateboarding race. Five months later Eito Hachiya, nickname: Eight or "8" enrolls in school and wants to find out what happened. He even just looks like Masato! But mysteries surround him: Why does he know all the other six? Why canβt they remember him? \n \nNote: Was cancelled after ~25% of volume 4, the epilogue consists of an alternative ending for Eight.'}, isLocked = False, links = {'al': '38734', 'ap': 'eight', 'kt': '17709', 'mu': '6521', 'amz': 'https://www.amazon.co.jp/dp/B07WS2K894', 'mal': '8734', 'raw': 'https://csbs.shogakukan.co.jp/book?book_group_id=14478'}, originalLanguage = ja lastVolume = 4, lastChapter = 37.6, publicationDemographic = seinen, status = completed, year = 2000, contentRating = safe createdAt = 2018-02-04 21:32:02+00:00, uploadedAt = 2022-01-12 21:42:40+00:00), author_id = ['905aaced-1556-4925-bff0-14ea277fb0b1', '905aaced-1556-4925-bff0-14ea277fb0b1'], artist_id = [], cover_id = 51bf2e88-98ac-4fd7-afb5-80edff694d53 ```
You can also use the get_manga_list()
method to search for manga.
The usage is like this
```py
manga_list = api.get_manga_list(title = "You manga title here") ```
~~NOTE: The search rigth now is faulty but tahts is an api problem. At the moment the only parameters that work are: title
, limit
and offset
~~
The search is now working so the above is no longer true
```py
manga = api.view_manga_by_id(manga_id = "0001183c-2089-48e9-96b7-d48db5f1a611") ```
```py
random_manga = api.random_manga() ```
Get the chapter, or chapters from the feed of a specific manga.
```py
manga_feed = api.manga_feed(manga_id = "0001183c-2089-48e9-96b7-d48db5f1a611", limit = 1) [Chapter(chapter_id = 015979c8-ffa4-4afa-b48e-3da6d10279b0, title = Navel-Gazing, volume = 3, chapter = 23.0, translatedLanguage = en, hash = data = List[filenames], publishAt = 2018-03-19 01:32:00+00:00, createdAt = 2018-03-19 01:32:00+00:00, uploadedAt = 2018-03-19 01:32:00+00:00, group_id = 59957a04-fa91-4099-921d-7e7988a19acb, manga_id = 0001183c-2089-48e9-96b7-d48db5f1a611, uploader = e19519ce-8c5f-4d7c-8280-704a87d34429)] ```
Get a manga volumes and chapters
```py
api.get_manga_volumes_and_chapters(manga_id = "the manga id") ```
Returns a Chpater Object by its id
```py
chapter = api.get_chapter(chapter_id = "015979c8-ffa4-4afa-b48e-3da6d10279b0") chapter Chapter(chapter_id = 015979c8-ffa4-4afa-b48e-3da6d10279b0, title = Navel-Gazing, volume = 3, chapter = 23.0, translatedLanguage = en, hash = data = List[filenames], publishAt = 2018-03-19 01:32:00+00:00, createdAt = 2018-03-19 01:32:00+00:00, uploadedAt = 2018-03-19 01:32:00+00:00, group_id = 59957a04-fa91-4099-921d-7e7988a19acb, manga_id = 0001183c-2089-48e9-96b7-d48db5f1a611, uploader = e19519ce-8c5f-4d7c-8280-704a87d34429) ```
It will return a list of chapters
```py
chapter_list = api.chapter_list() ```
If you want the chpaters of a given Manga, you'll need to specify the feed endpoints
Return the links for the chapter images for a given Chapter Object. This is a Chapter method
```py
Chapter.fetch_chapter_images() ```
Get a User by id
```py
user = api.get_user(user_id = "id of user") ```
The list of the manga tags
```py
tag_list = api.tag_list() ```
Get a Scanlation Group list
```py
api.scanlation_group_list() ```
Get the cover image list
```py
api.get_coverart_list() ```
```py
api.get_cover(cover_id = "the cover id") ```
```py
api.edit_cover(cover_id = "the cover id", description = "the cover description, can be null", volume = "the volume number", version = "int, the cover version") ```
```py
CoverArt.fetch_cover_image() ```
This is a CoverArt method that returns the cover image url of that object
To create an account
```py
api.create_account(username = "your username", password = "your password", email = "[email protected]", ObjReturn = False) ```
This will send you an activation code, this is the one to pass to activate_account
.
```py
api.acticate_account(code = "the code sent") ```
If you need another activation code:
```py
api.resend_activation_code(email = "[email protected]") ```
To recover and account
```py
api.recover_account(email = "[email protected]") ```
This will send you and activation code that you need
```py
api.complete_account_recover(code = "the code sent to you", newPassword = "the new password for the account") ```
Method to login to the website
```py
api.login(username = USERNAME, password = PASSWORD) ```
It is recomended that you add this values to you path for security reasons.
Get your user info
```py
my_user = api.me() ```
Get your manga follow list!
```py
follow_list = api.get_my_mangalist() ```
This functions, as well as most of the other ones accept optional parameters. This are:
limit
: limits the amout of results. It accepts a value between 1 and 100, the default if 10offset
: Makes an offset of the velue provided to the list. Accepts values >= 0Get the list of the Scanlination group you follow!
```py
scangroups_followlist = api.get_my_followed_groups() ```
The list of the users you follow
```py
followed_users = api.get_my_followed_users() ```
Get a list of the capters marked as read for a given manga
```py
read_chapters = api.get_manga_read_markes(id = "the manga id") ```
Get a list of the all the manga reading stauts
```py
my_manga_reading_stauts = api.get_all_manga_reading_status() ```
Get the reading status of a specific manga
```py
manga_reading_status = api.get_manga_reading_status(manga_id = "the manga id") ```
```py
api.update_manga_reading_status(manga_id = "the manga id", status = "the new reading status") ```
The status
parameter can take the following values:
"reading"
"on_hold"
"plan_to_read"
"dropped"
"re_reading"
"completed"
Follow a manga
```py
api.follow_manga(manga_id = "the manga id") ```
Unfollows a manga
```py
api.unfollow_manga(manga_id = "the manga id") ```
Creates a manga
```py
api.create_manga(title = "manga title", ) ```
Updates a manga
```py
api.update_manga(manga_id = "the manga id") ```
Deletes manga
```py
api.delete_manga(manga_id = "the manga id") ```
Add a manga to a custom list
```py
api.add_manga_to_customlist(manga_id = "the manga id", list_id = "the list id") ```
Removes a manga from a custom list
```py
api.remove_manga_from_customlist(id = "the manga id", listId = "the list id") ```
```py
api.create_customlist() #this will create a custom list with no special parameters ```
name
. The custom list namevisibility
. The visibility of the custom list. Default publicmanga
. The list of manga ids```py
api.get_customlist(id = "th custom list id") ```
```py
api.update_customlist(id = "the custom list id") ```
name
. The custom list namevisibility
. Values : "public"
"private"
```py
api.delete_customlist(id = "the custom list id") ```
```py
api.get_user_customlists(id = "the user id") ```
limit
. The limit of custom lists to returnoffset
. The amout of offset```py
api.create_author(name = "author name", version = 1, ObjReturn = False) ```
```py
api.update_author(id = "the author id", version = "int with the version", name = "author's name", ObjReturn = False) ```
```py
api.delete_author(id = "the author id") ```
All the credit for the API goes to the Mangadex Team.
So i have a problem with the fetchchapterimages method that throws me a typeerror exception:
I dont know if i am doing something not correctly or something, thanks in advance
PD: I am new as python developer
Does it supports account creation?
There was an issue mentioned in #12 and #13, that caused a syntax error, while this was fixed in the repo, this fix didn't make it to the PyPI probably causing the package was not usable. This release is meant to push the fix to the PyPI so the package continues to be usable.
Full Changelog: https://github.com/EMACC99/mangadex/compare/v2.5.1...v2.5.2
In this release, the models have been refactored in a way that the alternate constructors are now @classmethods
and now more easy to read and the definition of now public and private methods are well defined. An important change to note is that some arguments have changed, all the ids are now something like: manga_id
, user_id
, etc. This si to avoid conflict with the reserved keyword id
n python and to have a more self-explanatory code.
I need to create this release as a pypi error keeps popping up
In this release,the function get_customlist_mangafedd() is no longer supported.
ApiError now has a more detailed error message.
KeyError exceptions were found in some other functions that no issues were open for.
This all was spotted because of the increased tests that were implemented recently.
As always if you want to contribute, you can do so by opening an issue o doing a PR.
Fixed KeyError reported in #11. This is a minor release but contains an urgent bug fix. Doing some investigations, it seems this error was caused by some changes in the server response, nothing too serious.
mangadex manga python-library python api api-wrapper wrapper