Skip to main content

<SHORTDESC>

Project description

whratio

PyPI downloads PyPI version PyPI pyversions

Calculate integer and decimal aspect ratio for dimensions.

CLI examples

    $ whratio 1024 768
    4 3 1.33
    $ whratio -d -n6 256 196
    1.306122
    whratio -WH 2560 1080 | tr " " :
    64:27

Python package examples

    >>> from whratio import ratio

    >>> ratio.as_int(1920, 1080)
    (16, 9)

    >>> ratio.as_float(1920, 1080)
    1.77

    >>> ratio.as_float(1920, 1080, ndigits=4)
    1.7778

Installation

Using pip:

    # pip3 install whratio

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

whratio-2.0.1.tar.gz (2.2 kB view hashes)

Uploaded Source

Built Distribution

whratio-2.0.1-py3-none-any.whl (2.0 kB view hashes)

Uploaded Python 3

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