Metadata-Version: 2.4
Name: aspect-ratio-too
Version: 0.2.0
Summary: Aspect ratio calculations.
Project-URL: Repository, https://bitbucket.org/xstudios/aspect-ratio-too.git
Project-URL: Issues, https://bitbucket.org/xstudios/aspect-ratio-too/issues
Project-URL: Changelog, https://bitbucket.org/xstudios/aspect-ratio-too/src/master/HISTORY.md
Author-email: Tim Santor <tsantor@xstudios.com>
License-File: AUTHORS.md
License-File: LICENSE
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.11
Provides-Extra: cli
Requires-Dist: click>=8.1.8; extra == 'cli'
Requires-Dist: rich>=13.9.4; extra == 'cli'
Description-Content-Type: text/markdown

# Aspect Ratio Too

![Coverage](https://img.shields.io/badge/coverage-91.45%25-brightgreen)

## Overview

Aspect ratio calculations.

## Installation

```bash
uv add aspect-ratio-too
```

For CLI use, install optional extras:

```bash
uv add "aspect-ratio-too[cli]"
```

## Usage

Know the aspect ratio you want but do not know the corresponding width/height? Try this:

```python
from aspect_ratio_too import AspectRatioCalculator

arc = AspectRatioCalculator(16, 9)

# Get (width/height) tuple
arc.width_to_dimensions(1920)  # (1920, 1080)
arc.height_to_dimensions(1080)  # (1920, 1080)

arc.width_to_height(1920)  # 1080
arc.height_to_width(1080)  # 1920
```

Or calculate the aspect ratio given known pixel dimensions:

```python
from aspect_ratio_too import aspect_ratio, aspect_ratio_str

aspect_ratio(1920, 1080)  # 1.7777777777777777
aspect_ratio_str(1920, 1080)  # 16:9
```

## CLI

```bash
aspect-ratio ratio 1920 1080
aspect-ratio ratio-str 1920 1080
aspect-ratio width-to-height 16 9 1920
aspect-ratio height-to-width 16 9 1080
aspect-ratio width-to-dimensions 16 9 1920
aspect-ratio height-to-dimensions 16 9 1080
```

## Development

```bash
just --list
just env
just uv-install-dev
just pip-install-editable
```

## Testing

```bash
just pytest
just coverage
just open-coverage
```

For quick local quality checks:

```bash
just check
```

## Issues

If you experience any issues, please create one in the
[issue tracker](https://bitbucket.org/xstudios/aspect-ratio-too/issues).


---

# History

All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).

## 0.2.0 (2026-04-22)

- Added an `aspect-ratio` CLI wrapper command.
- Added optional `cli` dependencies (`click` and `rich`) so library-only installs do not require CLI packages.
- Added CLI command coverage in tests and packaging script entrypoint wiring.

## 0.1.1 (2023-06-22)

- Update packaging method to `pyproject.toml`.

## 0.0.1 (2022-11-07)

- First release
