{"id":31942253,"url":"https://github.com/irahorecka/comics","last_synced_at":"2026-03-01T04:07:11.595Z","repository":{"id":61146469,"uuid":"545209662","full_name":"irahorecka/comics","owner":"irahorecka","description":"GoComics API wrapper","archived":false,"fork":false,"pushed_at":"2025-06-12T20:09:23.000Z","size":450,"stargazers_count":28,"open_issues_count":2,"forks_count":5,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-09-24T18:56:55.467Z","etag":null,"topics":["api","comic-strips","comics","comics-downloader","gocomics"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/irahorecka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-10-04T01:05:58.000Z","updated_at":"2025-08-14T09:07:39.000Z","dependencies_parsed_at":"2024-01-28T15:08:02.331Z","dependency_job_id":"6d9e6d64-126e-4529-a44c-656e92cf31d9","html_url":"https://github.com/irahorecka/comics","commit_stats":{"total_commits":78,"total_committers":2,"mean_commits":39.0,"dds":0.02564102564102566,"last_synced_commit":"1e1621b80eb85caf267a4362c96c6d9d04d6c197"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/irahorecka/comics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irahorecka%2Fcomics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irahorecka%2Fcomics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irahorecka%2Fcomics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irahorecka%2Fcomics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/irahorecka","download_url":"https://codeload.github.com/irahorecka/comics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/irahorecka%2Fcomics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018625,"owners_count":26086404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","comic-strips","comics","comics-downloader","gocomics"],"created_at":"2025-10-14T09:41:34.962Z","updated_at":"2026-03-01T04:07:11.582Z","avatar_url":"https://github.com/irahorecka.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# comics\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://static.wikia.nocookie.net/garfield/images/8/83/GoComicsLogo.png/revision/latest/scale-to-width-down/2849?cb=20230628152535\" width=\"50%\"/\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n[GoComics](https://www.gocomics.com/) API wrapper\n\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\n[![pypiv](https://img.shields.io/pypi/v/comics.svg)](https://pypi.python.org/pypi/comics)\n[![Licence](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/irahorecka/comics/main/LICENSE)\n[![tests](https://github.com/irahorecka/comics/actions/workflows/ci.yml/badge.svg)](https://github.com/irahorecka/comics/actions)\n\n## Installation\n\n```bash\npip install comics\n```\n\n\u003e [!WARNING]\n\u003e **Breaking changes since v0.9.1**\n\u003e Versions prior to v0.9.1 are incompatible due to an upstream change. Upgrading to the latest release is required.\n\u003e ```\n\u003e pip install comics --upgrade\n\u003e ```\n\n\u003e [!NOTE]\n\u003e Playwright must be installed after installing `comics` to enable browser-based features:\n\u003e ```\n\u003e python -m playwright install --with-deps\n\u003e ```\n\n## Quick start\n\nFind and download the Calvin and Hobbes comic strip published on January 2, 1990:\n\n```python\nimport comics\n\nch = comics.search(\"calvinandhobbes\", date=\"1990-01-02\")\nch.download(\"calvinandhobbes.png\")\n```\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"docs/calvinandhobbes.png\"\u003e\n\u003c/div\u003e\n\n## Find comics\n\nAvailable comics can be found using the `directory` class:\n\n```python\nimport comics\n\n# List available comics - total of 401\ncomics.directory.listall()\n# \u003e\u003e\u003e (\"1-and-done\", \"9-chickweed-lane-classics\", \"9chickweedlane\", \"9to5\", ... )\n\n# Find endpoints for Calvin and Hobbes\ncomics.directory.search(\"Calvin and Hobbes\")\n# \u003e\u003e\u003e (\"calvinandhobbes\", \"calvinandhobbesenespanol\")\n```\n\nFirst, pass the desired endpoint to `comics.search`. For example, to search for Calvin and Hobbes comics in english use `comics.search(\"calvinandhobbes\")`; for spanish, use `comics.search(\"calvinandhobbesenespanol\")`.\n\n## Search and download comics\n\nThen, search for a comic strip by passing `date` into `search()`:\n\n```python\nimport comics\n\n# Get a Calvin and Hobbes comic strip by date\nch = comics.search(\"calvinandhobbes\", date=\"2013-05-13\")  # Also accepts datetime.date or datetime object\n\n# Get a random Calvin and Hobbes comic strip\nrandom_ch = comics.search(\"calvinandhobbes\", date=\"random\")\n```\n\nFinally, show, download, or stream the comic strip:\n\n```python\n# Show comic strip - opens in Jupyter notebook or default image viewer application\nch.show()\n\n# Download comic strip - defaults to {endpoint}.png if an export path is not provided\n# E.g., a Calvin and Hobbes comic strip will be exported as \"calvinandhobbes.png\" in the current working directory\nch.download()\n\n# Stream comic strip - useful if custom image content manipulation is desired\nch.stream()\n```\n\n### Retry logic\n\nIf a comic strip fails to load due to CDN delays or missing image data, a retry mechanism is built into `download()`, `show()`, and `stream()`. You can control this behavior via:\n\n- `retries`: number of attempts before failing (default = 5)\n- `base_delay`: exponential backoff seed time in seconds (default = 0.5)\n\nThis improves reliability when fetching newly released strips or handling transient issues.\n\n| Attempt | Wait Before Attempt (sec) | Cumulative Time (sec) |\n|---------|---------------------------|------------------------|\n| 1       | 0.0                       | 0.0                    |\n| 2       | 0.5                       | 0.5                    |\n| 3       | 1.0                       | 1.5                    |\n| 4       | 2.0                       | 3.5                    |\n| 5       | 4.0                       | 7.5                    |\n| 6       | 8.0                       | 15.5                   |\n\nRetry behavior can be customized per call:\n\n```python\n# Try 3 times total with shorter delay\nch.download(retries=2, base_delay=0.25)\n```\n\n## Attributes\n\nAn instantiated `search` class will have the following public attributes:\n\n```python\nimport comics\n\ngarfield = comics.search(\"garfield\")\ngarfield.endpoint\n# \u003e\u003e\u003e \"garfield\"\ngarfield.title\n# \u003e\u003e\u003e \"Garfield\"\ngarfield.start_date\n# \u003e\u003e\u003e \"1978-06-19\"\n```\n\nAn instantiated `search` class with `date` will have the following public attributes:\n\n```python\nimport comics\n\ngarfield = comics.search(\"garfield\", date=\"2000-08-20\")\ngarfield.endpoint\n# \u003e\u003e\u003e \"garfield\"\ngarfield.title\n# \u003e\u003e\u003e \"Garfield\"\ngarfield.date\n# \u003e\u003e\u003e \"2000-08-20\"\ngarfield.url\n# \u003e\u003e\u003e \"https://www.gocomics.com/garfield/2000/08/20\"\ngarfield.image_url\n# \u003e\u003e\u003e \"https://assets.amuniversal.com/6694c52099bd01365606005056a9545d\"\n```\n\n## Exceptions\n\nAn exception will be thrown if the queried date is unregistered or before the comic's origin date:\n\n```python\nimport comics\n\ntry:\n    peanuts = comics.search(\"peanuts\", date=\"1900-01-01\")\n    peanuts.download()\nexcept comics.exceptions.InvalidDateError:\n    print(\"Whoops, an invalid date was queried.\")\n```\n\nAn exception will be thrown if the queried endpoint is unregistered:\n\n```python\nimport comics\n\ntry:\n    invalid_comic = comics.search(\"invalid_endpoint\", date=\"2000-01-01\")\n    invalid_comic.download()\nexcept comics.exceptions.InvalidEndpointError:\n    print(\"Whoops, an invalid endpoint was queried.\")\n```\n\nAn exception will be thrown if Playwright fails to fetch a comic (e.g., browser not installed or page error):\n\n```python\nimport comics\n\ntry:\n    garfield = comics.search(\"garfield\", date=\"2020-05-05\", force_playwright=True)\n    garfield.download()\nexcept comics.exceptions.ComicsPlaywrightError:\n    print(\"Playwright failed to fetch the page. Check your Playwright installation.\")\n```\n\n## Contribute\n\n- [Issues Tracker](https://github.com/irahorecka/comics/issues)\n- [Source Code](https://github.com/irahorecka/comics/tree/main/comics)\n\n## Support\n\nIf you are having issues or would like to propose a new feature, please use the [issues tracker](https://github.com/irahorecka/comics/issues).\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"docs/dilbert.png\"\u003e\n\u003c/div\u003e\n\n## License\n\nThis project is licensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firahorecka%2Fcomics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firahorecka%2Fcomics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firahorecka%2Fcomics/lists"}