Metadata-Version: 2.4
Name: nrc-to-jpg
Version: 2026.1.0
Summary: Save the NRC front page to a JPG image.
Keywords: 
Author: Steven van de Graaf
Author-email: Steven van de Graaf <steven@vandegraaf.xyz>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Dist: click
Requires-Dist: httpx2
Requires-Python: >=3.11, <4
Project-URL: Documentation, https://nrc-to-jpg.readthedocs.io/en/stable/
Project-URL: Changelog, https://nrc-to-jpg.readthedocs.io/en/stable/changelog.html
Project-URL: Source Code, https://github.com/sgraaf/nrc-to-jpg
Project-URL: Issue Tracker, https://github.com/sgraaf/nrc-to-jpg/issues
Description-Content-Type: text/markdown

<!-- start docs-include-index -->

# nrc-to-jpg

[![PyPI](https://img.shields.io/pypi/v/nrc-to-jpg)](https://img.shields.io/pypi/v/nrc-to-jpg)
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/nrc-to-jpg)](https://pypi.org/project/nrc-to-jpg/)
[![CI](https://github.com/sgraaf/nrc-to-jpg/actions/workflows/ci.yml/badge.svg)](https://github.com/sgraaf/nrc-to-jpg/actions/workflows/ci.yml)
[![Test](https://github.com/sgraaf/nrc-to-jpg/actions/workflows/test.yml/badge.svg)](https://github.com/sgraaf/nrc-to-jpg/actions/workflows/test.yml)
[![Documentation Status](https://readthedocs.org/projects/nrc-to-jpg/badge/?version=latest)](https://nrc-to-jpg.readthedocs.io/en/latest/?badge=latest)

<!-- [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/<PROJECT-NUMBER>/badge)](https://www.bestpractices.dev/projects/<PROJECT-NUMBER>) -->

Save the NRC front page to a JPG image.

<!-- end docs-include-index -->

## Installation

<!-- start docs-include-installation -->

*nrc-to-jpg* is available on [PyPI](https://pypi.org/project/nrc-to-jpg/). Install with [uv](https://docs.astral.sh/uv/) or your package manager of choice:

```shell
uv tool install nrc-to-jpg
```

<!-- end docs-include-installation -->

## Documentation

Check out the [*nrc-to-jpg* documentation](https://nrc-to-jpg.readthedocs.io/en/stable/) for the [User's Guide](https://nrc-to-jpg.readthedocs.io/en/stable/usage.html) and [CLI Reference](https://nrc-to-jpg.readthedocs.io/en/stable/cli.html).

## Usage

<!-- start docs-include-usage -->

Running `nrc-to-jpg --help` or `python -m nrc_to_jpg --help` shows a list of all of the available options and arguments:

<!-- [[[cog
import cog
from click.testing import CliRunner
from nrc_to_jpg import cli
result = CliRunner().invoke(cli.cli, ["--help"], terminal_width=88)
output = result.output.replace("Usage: cli", "Usage: nrc-to-jpg")
help_text = "\n".join(line.rstrip() for line in output.splitlines()).rstrip()
cog.outl(f"\n```shell\nnrc-to-jpg --help\n{help_text}\n```\n")
]]] -->

```shell
nrc-to-jpg --help
Usage: nrc-to-jpg [OPTIONS]

  Save the NRC front page to a JPG image.

Options:
  -d, --date [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]
                                  The date to save that day's front page of.  [default:
                                  (today)]
  -n, --page-number INTEGER       The page number to save.  [default: 1]
  -o, --output FORMAT-STR         Output file name template. Allowed fields: `day`,
                                  `month`, `page_number`, `year`  [default: NRC-front-
                                  page_{year:04}-{month:02}-{day:02}.jpg]
  -v, --version                   Show the version and exit.
  -h, --help                      Show this message and exit.
```

<!-- [[[end]]] -->

To save today's front page to `NRC_front_page_{year:04}-{month:02}-{day:02}.jpg`, simply use `nrc-to-jpg` without any options:

```sh
nrc-to-jpg
```

To save the front page for a different date than today, use the `--date` option:

```sh
nrc-to-jpg --date 2001-09-12
```

To save a page other than the front page, use the `--page-number` option:

```sh
nrc-to-jpg --page-number 2
```

This will still save the specified page to `NRC_front_page_{year:04}-{month:02}-{day:02}.jpg`. You might want to customize the output template using the `--output` option:

```sh
nrc-to-jpg --page-number 2 --output NRC_{page_number}nd_page_{year:04}-{month:02}-{day:02}.jpg
```

<!-- end docs-include-usage -->
