Skip to main content

Get your daily dose of xkcd directly from the terminal! 🤩

Project description

xkcd cli tool

Get your daily dose of xkcd directly from the terminal! 🤩

xkcd is a webcomic created by Randall Munroe. It is a comic of Language, Math, Romance and Sarcasm and a couple of other categories.

If kitty is used as the terminal, the xkcd comic will be rendered directly in the terminal, otherwise the default viewer for PNG images is used. This tool requires fzf to be installed on the machine to filter available comics by their title.

Installation

With pip

Install this package directly from the Python Package Index (PyPI). The CLI tool requires Python >= 3.8 to be installed.

$ pip install dcs-xkcd-cli

This will install a CLI tool named xkcd which can be used as described below.

With pipx

Installation with pipx is similar to the pip variant above, but uses pipx instead of pip.

$ pipx install dcs-xkcd-cli

Note that with pipx, this package can be tried out without the need to install it permanently.

$ pipx run dcs-xkcd-cli <args>

Usage

Search by title

$ xkcd show

This functionality requires fzf to be installed.

Show latest xkcd comic

$ xkcd show --latest

Show random xkcd comic

$ xkcd show --random

Show xkcd comic by its ID

$ xkcd show --comic-id 207

Enforce render optimizations for kitty terminal

$ xkcd show --use-kitty

Use this command if the auto-detection of the kitty terminal does not work as expected. Kitty is auto-detected by inspecting if the $TERM variable includes the term kitty.

By default the image is upscaled to the terminal width. Use the --no-kitty-scale-up flag to disable this feature if needed.

Disable or update cache

Under the hood this tool uses a cache which is updated once per day transparently. The cache is used to remember the list of xkcd comics from the archive.

To disable the cache, use the following command

$ xkcd show --no-cache

To update the cache manually, use the following command

$ xkcd update-cache

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

dcs-xkcd-cli-1.0.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

dcs_xkcd_cli-1.0.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file dcs-xkcd-cli-1.0.0.tar.gz.

File metadata

  • Download URL: dcs-xkcd-cli-1.0.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.13.0-1021-azure

File hashes

Hashes for dcs-xkcd-cli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c4435a7e639853beacc43ca81c91eca3141d3d3919afb2e62ea469e3b12fdd28
MD5 e9cf9f10c3d0d7eaabac37591387d46b
BLAKE2b-256 9cf2e9fa88c7ad4c6203ee09b044b9bb12c01d5b39efeb9553aa77348730617d

See more details on using hashes here.

File details

Details for the file dcs_xkcd_cli-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: dcs_xkcd_cli-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.13.0-1021-azure

File hashes

Hashes for dcs_xkcd_cli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aebdeea907c2e2fad08fbfa74d0f00faf0f30f375ab808233cf29d5836658223
MD5 0f6a2f594d77265b45869588c20d4e28
BLAKE2b-256 4ec892299c3a29dcb686e0a3a1c08fa94c2af6686d51ad33a8aa4dc4198a8bbc

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