Skip to main content

macals

Python module for accessing the ambient light sensor on macOS

Usage

Command Line

python -m macals

This will iterate all ambient light sensors and their lux values.

Python

from macals import list_sensors

for sensor in list_sensors:
    print(f'{sensor.name}: {sensor.get_current_lux()} lux')

There is likely only ever to be a single sensor, so macals.find_sensor() is probably fine to use, which just returns the first.

from macals import find_sensor

sensor = find_sensor()
print(f'{sensor.name}: {sensor.get_current_lux()} lux')

You can also just use the LightSensor class if you know the service name:

from macals import LightSensor

sensor = LightSensor('AppleSPUVD6286')
print(f'{sensor.name}: {sensor.get_current_lux()} lux')

Release files for macals 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for macals 0.1.0
File Size Uploaded
macals-0.1.0.tar.gz 4.7 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for macals 0.1.0
File Interpreter ABI Platform
macals-0.1.0-cp313-cp313-macosx_15_0_universal2.whl CPython 3.13 CPython 3.13 macOS 15.0+ universal2 (ARM64, x86-64) Details
macals-0.1.0-cp312-cp312-macosx_15_0_universal2.whl CPython 3.12 CPython 3.12 macOS 15.0+ universal2 (ARM64, x86-64) Details
macals-0.1.0-cp311-cp311-macosx_15_0_universal2.whl CPython 3.11 CPython 3.11 macOS 15.0+ universal2 (ARM64, x86-64) Details

Total release size: 27.6 kB

Release files / macals-0.1.0.tar.gz

Download URL macals-0.1.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ce9972ef25cc175a8062d960774a9f7f61ed60c7b93d03b69b7df72f117f9232
BLAKE2b-256 checksum
How to use checksums
494112cc43dea5ae1ec1ef221c0e75fbfbdfee97f6bf512fc2ac3cc1c250b624
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2025.

Transparency log

Release files / macals-0.1.0-cp313-cp313-macosx_15_0_universal2.whl

Download URL macals-0.1.0-cp313-cp313-macosx_15_0_universal2.whl
Size 7.6 kB
Tags CPython 3.13 macOS 15.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
46ba9a1b50b4db4080e1de103eabe6600082604ce705332e4d69af26922311e6
BLAKE2b-256 checksum
How to use checksums
a50c4f999bf03575b0ab9d88c0befdc98444e8833fb970546014c9c1ee305868
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2025.

Transparency log

Release files / macals-0.1.0-cp312-cp312-macosx_15_0_universal2.whl

Download URL macals-0.1.0-cp312-cp312-macosx_15_0_universal2.whl
Size 7.6 kB
Tags CPython 3.12 macOS 15.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
6884618084373e7e7874086237d12df8fff92b48f2bb353845502e9ea6bf0086
BLAKE2b-256 checksum
How to use checksums
278671ce9a42b4723be0433a756d6c31ba220126961f1b0d79d20243db0dcf12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2025.

Transparency log

Release files / macals-0.1.0-cp311-cp311-macosx_15_0_universal2.whl

Download URL macals-0.1.0-cp311-cp311-macosx_15_0_universal2.whl
Size 7.6 kB
Tags CPython 3.11 macOS 15.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
914ca9be419c64303931b09432e9851cec79164afa8fa8f932b46de6599e4268
BLAKE2b-256 checksum
How to use checksums
23e1695f87edac5ee53134719fa0ac4c9eb7e26cede6206dbb5662528a161cc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page