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.

Source Distribution

whratio-3.1.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

whratio-3.1.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file whratio-3.1.1.tar.gz.

File metadata

  • Download URL: whratio-3.1.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.6

File hashes

Hashes for whratio-3.1.1.tar.gz
Algorithm Hash digest
SHA256 08b4ea847069d1bd931aa07922b107340ef4de009e55af84b64631b3bbaa3dc6
MD5 541e53ca4adcbcbbfd351cac18db6588
BLAKE2b-256 22fb78b3746f85c7308378ffc7a89c194e6087c24aa8a4f1cbb73778c04ef8ea

See more details on using hashes here.

File details

Details for the file whratio-3.1.1-py3-none-any.whl.

File metadata

  • Download URL: whratio-3.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.6

File hashes

Hashes for whratio-3.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 df9ebdbdae4c7c52d93705379793d703528e5b23a94d2c7ae40bbc3fae738baa
MD5 904b70d82bb8bf20b475480ef1a286e4
BLAKE2b-256 528be480532f0cea055af7bb8debb4cdde6709667560f8ee2d253f7cd0423f83

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