Fetch comics from GoComics.
Project description
gocomics.py is a Pythonic, fun, and easy-to-use library for fetching comics and metadata from GoComics.com. Whether you want to build a comic reader, analyze trends, or just grab your favorite strip, this package is for you!
Features
Fetch any comic by identifier and date
Get comic metadata (title, author, description, images, etc.)
List all available comics and categories
Find popular and political comics
Fully documented and type-annotated
MIT licensed and open source
Why gocomics.py?
Simple: One-liner to fetch a comic!
Powerful: Access all the metadata you need
Community-driven: Contributions welcome
Inspired by comics: Because code should be fun!
Background
In 2024, GoComics.com changed its interface and added a paywall that blocks most comics from non-subscribers. gocomics.py works by programmatically fetching comic data and images, allowing you to access comics and metadata even if they are paywalled on the site.
Requirements
Python 3.8+
Installation
# Stable release
python3 -m pip install "gocomics.py" # Unix/macOS
py -m pip install "gocomics.py" # Windows
# Development version
git clone https://github.com/Ombucha/gocomics.py
Comic API
- gocomics.Comic - Fetch and explore a comic
.identifier (str): The comic’s identifier (e.g., “calvinandhobbes”)
.date (datetime, optional): The date of the comic (default: latest)
.title, .description, .image_url, .author, .followers_count, .about, .characters, etc.
.download(filename=None, path=None): Download the comic image
.show(filename=None, path=None): Open the comic image in your default viewer
.refresh(): Refresh the comic’s data
gocomics.search - List all comics (optionally filter by category or updated today)
gocomics.search_political - List political comics (optionally filter by category or updated today)
gocomics.get_popular_comics - Get trending/popular comics (optionally political)
gocomics.stream_comics - Iterate comics for a strip between two dates
Examples
Basic usage:
from gocomics import Comic
comic = Comic("calvinandhobbes")
print(comic.title)
print(comic.image_url)
Fetch a comic from a specific date:
from datetime import datetime
comic = Comic("garfield", datetime(2020, 1, 1))
print(comic.title, comic.image_url)
Download and show a comic:
path = comic.download(filename="garfield2020.png")
comic.show(filename="garfield2020.png")
Refresh comic data:
comic.refresh()
List all available comic identifiers:
from gocomics.utils import search
all_comics = search()
print(all_comics[:10]) # Show first 10
List comics in a category:
animal_comics = search(categories=["funny-animals"])
print(animal_comics)
List comics updated today:
updated_today = search(last_updated_today=True)
print(updated_today)
List political comics:
from gocomics.utils import search_political
political = search_political()
print(political)
List popular comics:
from gocomics.utils import get_popular_comics
popular = get_popular_comics()
print(popular)
List popular political comics:
popular_political = get_popular_comics(political=True)
print(popular_political)
Stream all comics for a strip between two dates:
from gocomics.utils import stream_comics
from datetime import datetime
for comic in stream_comics("garfield", start_date=datetime(2020, 1, 1), end_date=datetime(2020, 1, 5)):
print(comic.date, comic.title)
See the Documentation for full API details.
Contributing
We love contributions! Please see CONTRIBUTING.md for guidelines. Lint with pylint, follow PEP 8, and open a PR!
Support & Community
Found a bug? Open an issue on GitHub.
Questions? Join the discussions.
Be kind and have fun - see our Code of Conduct.
Links
License
MIT License. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gocomics_py-2.1.0.tar.gz.
File metadata
- Download URL: gocomics_py-2.1.0.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eecde8f92d0279a7fbc79c8594c5155c83c3e6bc7a58b7599c343d4b27fa710a
|
|
| MD5 |
1856807397ca0d96f127e9dbc9a7d82e
|
|
| BLAKE2b-256 |
348adabc29c8244f621900accca11972dc412c9c57877b2da632b1ff73aef84e
|
File details
Details for the file gocomics_py-2.1.0-py3-none-any.whl.
File metadata
- Download URL: gocomics_py-2.1.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93367deadc74c512419211ac7fbc6285dfde93b03ed18e221286d28b51ab6cba
|
|
| MD5 |
f8d18fd0d205c6577803fcee173ce992
|
|
| BLAKE2b-256 |
666c6e87be5e48614422a4e6c0388ab670bca2d2ce82983b525fc61c08d662e0
|