Skip to main content

Unofficial gocomics library

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

garfetch-0.2.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

garfetch-0.2.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file garfetch-0.2.0.tar.gz.

File metadata

  • Download URL: garfetch-0.2.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.10.10-arch1-1

File hashes

Hashes for garfetch-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5f0ec930d99f0315d9d714ad6aa2cd97a8ad95343088bc6a856b482c2be5d51a
MD5 cebf594a84e107a62eb7203c0f2d6724
BLAKE2b-256 9db8af47631fb1b2f45530b482076407e98807aefa7bb56bbd641367923c728b

See more details on using hashes here.

File details

Details for the file garfetch-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: garfetch-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.10.10-arch1-1

File hashes

Hashes for garfetch-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1cea5558895d21cf320f8e7820af0282cfeb9ec8704baaedb59bb3fb4ad417d
MD5 4afeee70c89d983fd619115f250faae6
BLAKE2b-256 c76e05b6410238ef97abecf5eee093b8b791cc99894119ee29f1265ec7dc5419

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page