Skip to main content

Python client for the Friday Movie Club API

Project description

Friday Movie Club Client

Python client for the Friday Movie Club API.

fmc wraps the FMC REST API in a synchronous, typed client built on httpx and pydantic. Resources are exposed as attributes on a single FMCClient:

Attribute Purpose
client.auth Register, login (email/password or PAT), refresh tokens
client.users Current-user profile and personal access tokens
client.clubs Club CRUD, members, invitations, cover images
client.movies Movie suggestions, rankings, TMDB search
client.events Event CRUD, RSVPs, movie assignment

Requirements

  • Python 3.12+

Installation

pip install python-fmc

Or with uv:

uv add python-fmc

Quickstart

from fmc import FMCClient

with FMCClient(base_url="https://api.example.com/api/v1") as client:
    # Login with email/password (sets the access token on the client)
    client.auth.login(email="user@example.com", password="hunter2")

    # Or login with a Personal Access Token
    # client.auth.login(token="fmc_pat_...")

    # Create a club and list its members
    club = client.clubs.create("Friday Movie Club", description="Weekly hangout")
    members = client.clubs.list_members(club.id)

    for user in members.items:
        print(user.name, user.email)

If you already have an access token, pass it directly:

client = FMCClient(base_url="...", token="eyJhbGciOi...")

Errors

API errors are raised as subclasses of FMCError:

from fmc import FMCClient, NotFoundError, ValidationError

try:
    club = client.clubs.get("00000000-0000-0000-0000-000000000000")
except NotFoundError:
    ...
except ValidationError as e:
    ...

Available exceptions: APIError, AuthenticationError, ForbiddenError, NotFoundError, ConflictError, ValidationError — all inherit from FMCError.

Examples

The examples/ directory contains runnable scripts that read BASE_URL and AUTH_TOKEN from the environment:

  • create-club/ — create a club if it doesn't already exist
  • create-suggestions/ — bulk-suggest movies from a JSON file
  • create-events/ — create movie-night events from a JSON file
export BASE_URL=https://api.example.com/api/v1
export AUTH_TOKEN=fmc_pat_...
python examples/create-club/create-club.py

Development

This project uses uv for dependency management and ruff for linting.

uv sync
uv run ruff check
uv build

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

python_fmc-1.6.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

python_fmc-1.6.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file python_fmc-1.6.0.tar.gz.

File metadata

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

File hashes

Hashes for python_fmc-1.6.0.tar.gz
Algorithm Hash digest
SHA256 4f12b5da4a38f6cd93823fb98595f76e17859e2b8e42296ddb63960686242da7
MD5 a6abc26cd67a05ced1c7a79f9438401c
BLAKE2b-256 e7b239a18616df40af660942e2d590135c7deb36d920fc6fb050a6fcdcdfa43e

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_fmc-1.6.0.tar.gz:

Publisher: publish.yml on friday-movie-club/pyfmc

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

File details

Details for the file python_fmc-1.6.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for python_fmc-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c55f998c61d680468d7465b8d8fd4a98c828f636425ad0acf708b5ab573c360
MD5 e2ad7beacb40db64b3c6c03885f6df4e
BLAKE2b-256 b64e4c0566154e33e63889d40d6156d9b9e2ebb274145edd3f4c2681fc1cf8e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_fmc-1.6.0-py3-none-any.whl:

Publisher: publish.yml on friday-movie-club/pyfmc

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