Metadata-Version: 2.4
Name: logmar
Version: 0.1.0
Summary: Convert between visual-acuity notations: logMAR, Snellen (20/x or 6/x), and decimal. Pure arithmetic, no dependencies.
Author: Vince Gonzalez
License: MIT
Project-URL: Homepage, https://opticquiz.com/
Project-URL: Source, https://github.com/vince-gonzalez/opticquiz.com
Keywords: logmar,visual-acuity,snellen,acuity,vision,optometry,ophthalmology,eye-test
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# logmar

**Convert visual acuity between logMAR, Snellen, and decimal.** Pure arithmetic, zero dependencies.

```bash
pip install logmar
```

```python
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.
