Skip to main content

Python SDK for accessing the MovieLens API (Data Analysts/Data Scientists friendly)

Project description

MovieLens SDK - hmoviessdk

A simple Python SDK to interact with the MovieLens REST API.It is designed for Data Analysts and Data Scientists, with native support for Pydantic, dictionnary and Pandas DataFrames.

PyPI version License: MIT


Installation

pip install hmoviessdk

Configuration

from hmoviessdk import MovieClient, MovieConfig

# Configuration with your API URL (Render or local)
config = MovieConfig(movie_base_url="https://api-architecture.onrender.com")
client = MovieClient(config=config)

Test the SDK

1. Health check

client.health_check()
# Return: {"status": "ok"}

2. Retrieve a movie

movie = client.get_movie(1)
print(movie.title)

3. List of movies in DataFrame format

df = client.list_movies(limit=5, output_format="pandas")
print(df.head())

Output mode available

All list methods (list_movies, list_ratings, etc.) can return :

  • Pydantic object (défaut)
  • dictionnary
  • Pandas DataFrames

Example :

client.list_movies(limit=10, output_format="dict")
client.list_ratings(limit=10, output_format="pandas")

Local test

You can also use local API :

config = MovieConfig(movie_base_url="http://localhost:8000")
client = MovieClient(config=config)

Target audience

  • Data Analysts
  • Data Scientists
  • Students in Data
  • Python Developers

Licence

MIT License


Useful Links

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

hmoviessdk-0.0.2.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

hmoviessdk-0.0.2-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file hmoviessdk-0.0.2.tar.gz.

File metadata

  • Download URL: hmoviessdk-0.0.2.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for hmoviessdk-0.0.2.tar.gz
Algorithm Hash digest
SHA256 766fcb122e9f3b0cb04a77ee0db41ea2bdb6609d0670e44cef165771cbdac2f8
MD5 0d52b9ab48040f652e27c8930cfaf7fa
BLAKE2b-256 73463fc83670ccab94bf5e4ea44ab0b3609a9590f474572e386bd405a65527d7

See more details on using hashes here.

File details

Details for the file hmoviessdk-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: hmoviessdk-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for hmoviessdk-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b1e5ba5546ed41af8ac452a2f574e3e0c4b7ccbe3c00baf0290b9631b1f3eb5e
MD5 c669da9a022fc9fdca7e08afea209306
BLAKE2b-256 4d6863d74eb160ce7e8252364576814b5241d22afef81e781d60efdf03631cd8

See more details on using hashes here.

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