Skip to main content

Calculate integer and decimal aspect ratio for dimensions.

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.3333333333333333
    $ whratio -d -n 2 256 196
    1.31
    whratio -WH 2560 1080 | tr " " :
    64:27

Python package examples

    >>> import whratio

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

    >>> whratio.as_float(1920, 1080)
    1.7777777777777777

    >>> round(whratio.as_float(1920, 1080), 2)
    1.78

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.

Files for whratio, version 3.1.1
Filename, size File type Python version Upload date Hashes
Filename, size whratio-3.1.1-py3-none-any.whl (4.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size whratio-3.1.1.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page