Skip to main content

Async client for Planet Fitness AU (PerfectGym) club occupancy

Project description

pfau-occupancy

Async Python client for Planet Fitness Australia club occupancy, backing a Home Assistant integration. Data comes from the member portal (PerfectGym ClientPortal2), which exposes a live "members currently in club" count for every club in a single authenticated call.

This library deliberately does only the API layer: login, session handling, and fetching occupancy. All Home Assistant concerns (entities, config flow, coordinator) live in the pfau-occupancy-ha integration that depends on this package.

Install

pip install pfau-occupancy

Usage

import asyncio
from pfau_occupancy import PlanetFitnessClient

async def main():
    async with PlanetFitnessClient("you@example.com", "password") as client:
        clubs = await client.async_get_clubs()
        for club in clubs:
            print(club.name, club.occupancy)

asyncio.run(main())

The client logs in automatically on first fetch and re-authenticates once if the session expires, so a long-running poller keeps working without intervention.

Data notes

The occupancy endpoint returns every club in one response. Each club carries a name, address, a currently-in-club count, and a capacity limit (often null). The response has no club ID, so the (slugified) club name is the stable identity used for entity unique_ids. A club being renamed therefore looks like one club disappearing and another appearing.

Disclaimer

This uses the member portal's internal endpoints, which are undocumented and may change or break without notice. It requires your own valid membership credentials. Use it with your own account and keep polling gentle.

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

pfau_occupancy-0.1.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pfau_occupancy-0.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file pfau_occupancy-0.1.0.tar.gz.

File metadata

  • Download URL: pfau_occupancy-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pfau_occupancy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0b15b417659182eb13e814197642a88eaa848c07dc0b6fbce8e668a447045ff7
MD5 7de62d23c99b643e2dda8f9cc0a0d5dd
BLAKE2b-256 896d54c7c1fbf0aeeb68f2b658e1fb7bac668bca33ee4450975bec4d5bf03037

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfau_occupancy-0.1.0.tar.gz:

Publisher: publish.yml on dancmorgan/pfau-occupancy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pfau_occupancy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pfau_occupancy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pfau_occupancy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a97e1043b8237de13ef7bd2b3dfa51a589aa3584d1948dd9aacb0600d51f2833
MD5 2b87550dabf2cd6c84f78a77651935fe
BLAKE2b-256 87993960a0cf401c1245bf9fa8e10816ba61efd67f3b9bec6e1c2e31f69adb5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pfau_occupancy-0.1.0-py3-none-any.whl:

Publisher: publish.yml on dancmorgan/pfau-occupancy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page