logmar
Convert visual acuity between logMAR, Snellen, and decimal. Pure arithmetic, zero dependencies.
pip install logmar
import logmar
logmar.snellen_to_logmar("20/40") # 0.301
logmar.logmar_to_snellen(0.3) # "20/40"
logmar.snellen_to_logmar("6/12") # 0.301 (metric Snellen, same acuity)
logmar.decimal_to_logmar(0.5) # 0.301
logmar.logmar_to_decimal(0.0) # 1.0 (20/20)
API
snellen_to_logmar("20/40")/logmar_to_snellen(0.3, base=20)decimal_to_logmar(0.5)/logmar_to_decimal(0.3)snellen_to_decimal("20/40")/decimal_to_snellen(0.5, base=20)
logMAR = −log₁₀(decimal acuity); Snellen m/x has decimal m/x. 20/20 = 0.0 logMAR = 1.0
decimal; larger logMAR is worse acuity.
Licence
MIT.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
logmar-0.1.0.tar.gz
(3.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file logmar-0.1.0.tar.gz.
File metadata
- Download URL: logmar-0.1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd822995cd16553e4469ce7f6be772478525dd868cf2594a3f443bbf05a36af5
|
|
| MD5 |
c8dcd0fc65e4a92d3a3f7ffa65ce6243
|
|
| BLAKE2b-256 |
91d49ebd8b687bae0b06253df42631cc8033f152ab7484e82d90fad424c65867
|
File details
Details for the file logmar-0.1.0-py3-none-any.whl.
File metadata
- Download URL: logmar-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55b0b252c972e68d5afb54f7f92afb96420cb6b1152511163b4989ba2cd6f3f1
|
|
| MD5 |
82181efab194b1a6b50c46f630e78f42
|
|
| BLAKE2b-256 |
42d9b5dbdc17feaf5f5d25f5ed95fc1c20cd3cd19d7359041896e44df08e5ff3
|