Skip to main content

garfetch

Python 3 library to fetch comic images from gocomics.com.

Installation

PyPI

This package is available on PyPI as garfetch.

Building

This project uses poetry, and the recommended way of building it is running poetry build on the root of this repository.

Usage

Get comic URL

garfetch.fetch_url(comic, datestr) can be used to fetch comic URL for a given comic on a given day. Comic slug can be extracted from a gocomics URL. Date format is YYYY-MM-DD or YYYY/MM/DD.

import garfetch

print(garfetch.fetch_url("garfield", "1990-05-30"))
# 'https://assets.amuniversal.com/7e81c7c05d1a012ee3bd00163e41dd5b'

A non-existant comic or a server error will currently throw an AssertionError. This behavior may be changed in the future.

Get comic calendar

garfetch.fetch_calendar(comic, datestr) can be used to fetch a list of comics available on a given month. Comic slug can be extracted from a gocomics URL. Date input format is YYYY-MM or YYYY/MM. Date output format is a list of YYYY/MM/DDs.

import garfetch

print(repr(garfetch.fetch_calendar("garfield-classics", "2020-07")))
# ['2020/07/01', '2020/07/02', '2020/07/03', '2020/07/04', '2020/07/05', '2020/07/06', '2020/07/07', '2020/07/08', '2020/07/09', '2020/07/10', '2020/07/11', '2020/07/12', '2020/07/13', '2020/07/14', '2020/07/15', '2020/07/16', '2020/07/17', '2020/07/18', '2020/07/19', '2020/07/20', '2020/07/21', '2020/07/22', '2020/07/23', '2020/07/24', '2020/07/25', '2020/07/26', '2020/07/27', '2020/07/28', '2020/07/29', '2020/07/30', '2020/07/31']

print(repr(garfetch.fetch_calendar("garfield-classics", "2019-01")))
# ['2019/01/07', '2019/01/08', '2019/01/09', '2019/01/10', '2019/01/11', '2019/01/12', '2019/01/13', '2019/01/14', '2019/01/15', '2019/01/16', '2019/01/17', '2019/01/18', '2019/01/19', '2019/01/20', '2019/01/21', '2019/01/22', '2019/01/23', '2019/01/24', '2019/01/25', '2019/01/26', '2019/01/27', '2019/01/28', '2019/01/29', '2019/01/30', '2019/01/31']

A non-existant comic or a server error will currently throw an AssertionError. This behavior may be changed in the future.

Release files for garfetch 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for garfetch 0.2.0
File Size Uploaded
garfetch-0.2.0.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for garfetch 0.2.0
File Interpreter ABI Platform
garfetch-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.9 kB

Release files / garfetch-0.2.0.tar.gz

Download URL garfetch-0.2.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5f0ec930d99f0315d9d714ad6aa2cd97a8ad95343088bc6a856b482c2be5d51a
BLAKE2b-256 checksum
How to use checksums
9db8af47631fb1b2f45530b482076407e98807aefa7bb56bbd641367923c728b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.9.1 Linux/5.10.10-arch1-1

Release files / garfetch-0.2.0-py3-none-any.whl

Download URL garfetch-0.2.0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e1cea5558895d21cf320f8e7820af0282cfeb9ec8704baaedb59bb3fb4ad417d
BLAKE2b-256 checksum
How to use checksums
c76e05b6410238ef97abecf5eee093b8b791cc99894119ee29f1265ec7dc5419
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.9.1 Linux/5.10.10-arch1-1

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page