# mangadex.py
[](https://github.com/psf/black)
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](https://api.mangadex.org/docs/)
## Instaling the API wrapper module
### PyPI
```sh
pip install --Upgrade mangadex
```
### Installing via setuptools
```sh
python setup.py install --user
```
## Wrapper Usage
```py
>>> import mangadex as md
>>> auth = md.auth.Auth()
>>> manga = md.series.Manga(auth=auth)
>>> chapter = md.series.Chapter(auth=auth)
>>> customlist = md.series.CustomList(auth=auth)
>>> tag = md.series.Tag(auth=auth)
>>> cover = md.series.Cover(auth=auth)
>>> scangroup = md.people.ScanlationGroup(auth=auth)
>>> user = md.people.User(auth=auth)
>>> follows = md.people.Follows(auth=auth)
```
## Manga
### Getting the latest manga chapters
This is called mangalist in the [documentation](https://api.mangadex.org/docs.html#operation/get-search-manga)
```py
>>> manga_list = manga.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
```
### Searching manga
```py
>>> manga_list = manga.get_manga_list(title = "You manga title here")
```
### Getting manga information by its id
```py
>>> manga = manga.view_manga_by_id(manga_id = "0001183c-2089-48e9-96b7-d48db5f1a611")
```
### Getting random manga
```py
>>> random_manga = Manga.random_manga()
```
### Manga Feed
Get the chapter, or chapters from MDList.
```py
>>> manga_feed = Manga.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)]
```
## Chapter
### Get manga volumes and chapters
```py
>>> chapter.get_manga_volumes_and_chapters(manga_id = "the manga id")
```
### Get Chapter Info
```py
>>> chp = chapter.get_chapter(chapter_id = "015979c8-ffa4-4afa-b48e-3da6d10279b0")
>> chp
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)
```
### Chapter List
Returns a list of latest chapters
```py
>>> chapter_list = chapter.chapter_list()
```
### Chapter Images
Return the links for the chapter images.
```py
>>> chapter.fetch_chapter_images()
```
## Tag
### Get Tag List
```py
>>> tag_list = tag.tag_list()
```
## Scanlation Group
### Get Scanlation Group List
```py
>>> scangroup.scanlation_group_list()
```
## Cover
### Get Cover Images List
```py
>>> cover.get_coverart_list()
```
### Get Cover by Id
```py
>>> cover.get_cover(cover_id = "the cover id")
```
### Edit Cover
```py
>>> cover.edit_cover(cover_id = "the cover id", description = "the cover description, can be null", volume = "the volume number", version = "int, the cover version")
```
### Get cover image link
```py
>>> cover.fetch_cover_image()
```
This is a CoverArt method that returns the cover image url of that object
## Private Calls
### Login
**Username and password combo-only logins are deprecated as MangaDex shift to OAuth. [Personal clients](https://api.mangadex.org/docs/02-authentication/personal-clients/) are needed alongside it. [#26](https://github.com/EMACC99/mangadex/issues/26)**
Method to login to the website
```py
>>> auth.login(username = USERNAME, password = PASSWORD, client_id = clientId, client_secret = clientSecret)
```
It is recomended that you add this values to your environment variables and use text input for client-facing solutions for security reasons.
```py
>>> auth.login(os.environ['md_username'], os.environ['md_password'],os.environ['client_id'], os.environ['client_secret'])
```
### Your User Info
Get your user info
```py
>>> my_user = user.me()
```
### Get User Info
```py
>>> user = user.get_user(user_id = "id of user")
```
### Get Logged User Followed Manga List
Get your manga follow list!
```py
>>> follow_list = follows.get_my_mangalist()
```
### Get Logged User Followed Groups
Get the list of the Scanlation group you follow!
```py
>>> scangroups_followlist = follows.get_my_followed_groups()
```
### Get Logged User Followed Users
Get the list of the users you follow!
```py
>>> followed_users = follows.get_my_followed_users()
```
### Get chapters marked as read from a manga
Get a list of the chapters marked as read for a given manga
```py
>>> read_chapters = manga.get_manga_read_markes(id = "the manga id")
```
### Get all followed manga reading status
Get a list of the all the manga reading stauts
```py
>>> my_manga_reading_stauts = manga.get_all_manga_reading_status()
```
### Get a specific manga reading status
Get the reading status of a specific manga
```py
>>> manga_reading_status = manga.get_manga_reading_status(manga_id = "the manga id")
```
### Update Manga reading status
```py
>>> manga.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
Follow a manga
```py
>>> follows.follow_manga(manga_id = "the manga id")
```
### Unfollow a manga
Unfollows a manga
```py
>>> manga.unfollow_manga(manga_id = "the manga id")
```
### Create manga
Creates a manga
```py
>>> manga.create_manga(title = "manga title", )
```
### Update Manga
Update manga information
```py
>>> manga.update_manga(manga_id = "the manga id")
```
### Delete Manga
Deletes manga
```py
>>> manga.delete_manga(manga_id = "the manga id")
```
### Add manga to custom list
Add a manga to a custom list
```py
>>> customlist.add_manga_to_customlist(manga_id = "the manga id", list_id = "the list id")
```
### Remove a manga from custom list
Removes a manga from a custom list
```py
>>> customlist.remove_manga_from_customlist(id = "the manga id", listId = "the list id")
```
### Create a custom list
```py
>>> customlist.create_customlist() #this will create a custom list with no special parameters
```
### Get custom list
```py
>>> customlist.get_customlist(id = "custom list id")
```
### Update custom list
```py
>>> customlist.update_customlist(id = "custom list id")
```
### Delete custom list
```py
>>> customlist.delete_customlist(id = "the custom list id")
```
### Get User Custom list
```py
>>> customlist.get_user_customlists(id = "the user id")
```
### Create Author
```py
>>> author.create_author(name = "author name", version = 1, ObjReturn = False)
```
### Update Author
```py
>>> author.update_author(id = "the author id", version = "int with the version", name = "author's name", ObjReturn = False)
```
### Delete Author
```py
>>> author.delete_author(id = "the author id")
```
### Disclaimer
All the credit for the API goes to the MangaDex Team.
Raw data
{
"_id": null,
"home_page": null,
"name": "mangadex",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "python, mangadex",
"author": "Eduardo Ceja",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/7e/37/e2e5347931f79f2e35b6b6804ca41705428beb37fd76d5c77ce716e1ecd3/mangadex-2.7.tar.gz",
"platform": null,
"description": "# mangadex.py\n\n[](https://github.com/psf/black)\n\nA 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](https://api.mangadex.org/docs/)\n\n## Instaling the API wrapper module\n\n### PyPI\n\n```sh\npip install --Upgrade mangadex\n```\n\n### Installing via setuptools\n\n```sh\npython setup.py install --user\n```\n\n## Wrapper Usage\n\n```py\n>>> import mangadex as md\n>>> auth = md.auth.Auth()\n>>> manga = md.series.Manga(auth=auth)\n>>> chapter = md.series.Chapter(auth=auth)\n>>> customlist = md.series.CustomList(auth=auth)\n>>> tag = md.series.Tag(auth=auth)\n>>> cover = md.series.Cover(auth=auth)\n>>> scangroup = md.people.ScanlationGroup(auth=auth)\n>>> user = md.people.User(auth=auth)\n>>> follows = md.people.Follows(auth=auth)\n```\n\n## Manga\n\n### Getting the latest manga chapters\n\nThis is called mangalist in the [documentation](https://api.mangadex.org/docs.html#operation/get-search-manga)\n\n```py\n>>> manga_list = manga.get_manga_list(limit = 1) #limits the query to return just one manga\n>>> manga_list[Manga(manga_id = 0001183c-2089-48e9-96b7-d48db5f1a611, title = {'en': 'Eight'}, altTitles = [{'ja': '8\uff08\u30a8\u30a4\u30c8\uff09'}], 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\u2019t 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\n lastVolume = 4, lastChapter = 37.6, publicationDemographic = seinen, status = completed, year = 2000, contentRating = safe\n 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\n```\n\n### Searching manga\n\n```py\n>>> manga_list = manga.get_manga_list(title = \"You manga title here\")\n```\n\n### Getting manga information by its id\n\n```py\n>>> manga = manga.view_manga_by_id(manga_id = \"0001183c-2089-48e9-96b7-d48db5f1a611\")\n```\n\n### Getting random manga\n\n```py\n>>> random_manga = Manga.random_manga()\n```\n\n### Manga Feed\n\nGet the chapter, or chapters from MDList.\n\n```py\n>>> manga_feed = Manga.manga_feed(manga_id = \"0001183c-2089-48e9-96b7-d48db5f1a611\", limit = 1)\n[Chapter(chapter_id = 015979c8-ffa4-4afa-b48e-3da6d10279b0, title = Navel-Gazing, volume = 3, chapter = 23.0, translatedLanguage = en, hash =\n 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)]\n```\n\n## Chapter\n\n### Get manga volumes and chapters\n\n```py\n>>> chapter.get_manga_volumes_and_chapters(manga_id = \"the manga id\")\n```\n\n### Get Chapter Info\n\n```py\n>>> chp = chapter.get_chapter(chapter_id = \"015979c8-ffa4-4afa-b48e-3da6d10279b0\")\n>> chp\nChapter(chapter_id = 015979c8-ffa4-4afa-b48e-3da6d10279b0, title = Navel-Gazing, volume = 3, chapter = 23.0, translatedLanguage = en, hash =\ndata = 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)\n```\n\n### Chapter List\n\nReturns a list of latest chapters\n\n```py\n>>> chapter_list = chapter.chapter_list()\n```\n\n### Chapter Images\n\nReturn the links for the chapter images.\n\n```py\n>>> chapter.fetch_chapter_images()\n```\n\n## Tag\n\n### Get Tag List\n\n```py\n>>> tag_list = tag.tag_list()\n```\n\n## Scanlation Group\n\n### Get Scanlation Group List\n\n```py\n>>> scangroup.scanlation_group_list()\n```\n\n## Cover\n\n### Get Cover Images List\n\n```py\n>>> cover.get_coverart_list()\n```\n\n### Get Cover by Id\n\n```py\n>>> cover.get_cover(cover_id = \"the cover id\")\n```\n\n### Edit Cover\n\n```py\n>>> cover.edit_cover(cover_id = \"the cover id\", description = \"the cover description, can be null\", volume = \"the volume number\", version = \"int, the cover version\")\n```\n\n### Get cover image link\n\n```py\n>>> cover.fetch_cover_image()\n```\n\nThis is a CoverArt method that returns the cover image url of that object\n\n## Private Calls\n\n### Login\n\n**Username and password combo-only logins are deprecated as MangaDex shift to OAuth. [Personal clients](https://api.mangadex.org/docs/02-authentication/personal-clients/) are needed alongside it. [#26](https://github.com/EMACC99/mangadex/issues/26)**\n\nMethod to login to the website\n\n```py\n>>> auth.login(username = USERNAME, password = PASSWORD, client_id = clientId, client_secret = clientSecret)\n```\n\nIt is recomended that you add this values to your environment variables and use text input for client-facing solutions for security reasons.\n\n```py\n>>> auth.login(os.environ['md_username'], os.environ['md_password'],os.environ['client_id'], os.environ['client_secret'])\n```\n\n### Your User Info\n\nGet your user info\n\n```py\n>>> my_user = user.me()\n```\n\n### Get User Info\n\n```py\n>>> user = user.get_user(user_id = \"id of user\")\n```\n\n### Get Logged User Followed Manga List\n\nGet your manga follow list!\n\n```py\n>>> follow_list = follows.get_my_mangalist()\n```\n\n### Get Logged User Followed Groups\n\nGet the list of the Scanlation group you follow!\n\n```py\n>>> scangroups_followlist = follows.get_my_followed_groups()\n```\n\n### Get Logged User Followed Users\n\nGet the list of the users you follow!\n\n```py\n>>> followed_users = follows.get_my_followed_users()\n```\n\n### Get chapters marked as read from a manga\n\nGet a list of the chapters marked as read for a given manga\n\n```py\n>>> read_chapters = manga.get_manga_read_markes(id = \"the manga id\")\n```\n\n### Get all followed manga reading status\n\nGet a list of the all the manga reading stauts\n\n```py\n>>> my_manga_reading_stauts = manga.get_all_manga_reading_status()\n```\n\n### Get a specific manga reading status\n\nGet the reading status of a specific manga\n\n```py\n>>> manga_reading_status = manga.get_manga_reading_status(manga_id = \"the manga id\")\n```\n\n### Update Manga reading status\n\n```py\n>>> manga.update_manga_reading_status(manga_id = \"the manga id\", status = \"the new reading status\")\n```\n\nThe `status` parameter can take the following values:\n`\"reading\"` `\"on_hold\"` `\"plan_to_read\"` `\"dropped\"` `\"re_reading\"` `\"completed\"`\n\n### Follow a manga\n\nFollow a manga\n\n```py\n>>> follows.follow_manga(manga_id = \"the manga id\")\n```\n\n### Unfollow a manga\n\nUnfollows a manga\n\n```py\n>>> manga.unfollow_manga(manga_id = \"the manga id\")\n```\n\n### Create manga\n\nCreates a manga\n\n```py\n>>> manga.create_manga(title = \"manga title\", )\n```\n\n### Update Manga\n\nUpdate manga information\n\n```py\n>>> manga.update_manga(manga_id = \"the manga id\")\n```\n\n### Delete Manga\n\nDeletes manga\n\n```py\n>>> manga.delete_manga(manga_id = \"the manga id\")\n```\n\n### Add manga to custom list\n\nAdd a manga to a custom list\n\n```py\n>>> customlist.add_manga_to_customlist(manga_id = \"the manga id\", list_id = \"the list id\")\n```\n\n### Remove a manga from custom list\n\nRemoves a manga from a custom list\n\n```py\n>>> customlist.remove_manga_from_customlist(id = \"the manga id\", listId = \"the list id\")\n```\n\n### Create a custom list\n\n```py\n>>> customlist.create_customlist() #this will create a custom list with no special parameters\n```\n\n### Get custom list\n\n```py\n>>> customlist.get_customlist(id = \"custom list id\")\n```\n\n### Update custom list\n\n```py\n>>> customlist.update_customlist(id = \"custom list id\")\n```\n\n### Delete custom list\n\n```py\n>>> customlist.delete_customlist(id = \"the custom list id\")\n```\n\n### Get User Custom list\n\n```py\n>>> customlist.get_user_customlists(id = \"the user id\")\n```\n\n### Create Author\n\n```py\n>>> author.create_author(name = \"author name\", version = 1, ObjReturn = False)\n```\n\n### Update Author\n\n```py\n>>> author.update_author(id = \"the author id\", version = \"int with the version\", name = \"author's name\", ObjReturn = False)\n```\n\n### Delete Author\n\n```py\n>>> author.delete_author(id = \"the author id\")\n```\n\n### Disclaimer\n\nAll the credit for the API goes to the MangaDex Team.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python wrapper for the mangadex API",
"version": "2.7",
"project_urls": {
"Download": "https://github.com/EMACC99/mangadex/releases"
},
"split_keywords": [
"python",
" mangadex"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "43823757883abc77b5218bc75a4ff7057d7f3747e8045f86300d2bc8b1a9733a",
"md5": "0660585b428692fcb52fdde8139ef270",
"sha256": "dfb2396149e9762fb5c2425de2efa2a2ea8180f6e235bceca8344b464014600d"
},
"downloads": -1,
"filename": "mangadex-2.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0660585b428692fcb52fdde8139ef270",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 20129,
"upload_time": "2024-06-20T05:19:49",
"upload_time_iso_8601": "2024-06-20T05:19:49.279152Z",
"url": "https://files.pythonhosted.org/packages/43/82/3757883abc77b5218bc75a4ff7057d7f3747e8045f86300d2bc8b1a9733a/mangadex-2.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7e37e2e5347931f79f2e35b6b6804ca41705428beb37fd76d5c77ce716e1ecd3",
"md5": "4eea692113c691cdf3d5c8c11c630eea",
"sha256": "22b0bf4527e10fba62102d41cfcd4a444b4760e1a08b44c3f43f695bd9acd9bb"
},
"downloads": -1,
"filename": "mangadex-2.7.tar.gz",
"has_sig": false,
"md5_digest": "4eea692113c691cdf3d5c8c11c630eea",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 22828,
"upload_time": "2024-06-20T05:19:50",
"upload_time_iso_8601": "2024-06-20T05:19:50.552541Z",
"url": "https://files.pythonhosted.org/packages/7e/37/e2e5347931f79f2e35b6b6804ca41705428beb37fd76d5c77ce716e1ecd3/mangadex-2.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-20 05:19:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "EMACC99",
"github_project": "mangadex",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "certifi",
"specs": [
[
"==",
"2024.6.2"
]
]
},
{
"name": "charset-normalizer",
"specs": [
[
"==",
"3.3.2"
]
]
},
{
"name": "future",
"specs": [
[
"==",
"1.0.0"
]
]
},
{
"name": "idna",
"specs": [
[
"==",
"3.7"
]
]
},
{
"name": "python-dateutil",
"specs": [
[
"==",
"2.9.0.post0"
]
]
},
{
"name": "python-dotenv",
"specs": [
[
"==",
"1.0.1"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.32.3"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.16.0"
]
]
},
{
"name": "typing_extensions",
"specs": [
[
"==",
"4.12.2"
]
]
},
{
"name": "urllib3",
"specs": [
[
"==",
"2.2.2"
]
]
}
],
"lcname": "mangadex"
}