Skip to main content

Python SDK to access API MovieLens

Project description

MovieLens SDK - filmsdk-ibrahim

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, dictionaries, and Pandas DataFrames.


Installation

pip install filmsdk-ibrahim

Configuration

from filmsdk-ibrahim import MovieClient, MovieConfig

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

Test SDK

1. Health check

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

2. Get a film

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

3. List of films in DataFrame format

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

Available output modes

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

Pydantic objects (default)

Dictionaries

Pandas DataFrames

Example :

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

Test on local machine

You can also use a local API :

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

Liens utiles

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

filmsdk_ibrahim-0.0.2.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

filmsdk_ibrahim-0.0.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: filmsdk_ibrahim-0.0.2.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for filmsdk_ibrahim-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a7fc12dd44d68a3afb94807597b58c186300662437eda4914ed2ee832750351f
MD5 2b7b8f2566c6f90363d62d62119a5593
BLAKE2b-256 08b006df462fcdba894856bfa3dc2390d595479e3eeaf4a88c2a32aaa3e0153c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for filmsdk_ibrahim-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ef9e7686f1a9d155d3f17f838d60cec8a0a48a458c6650d0c1152f80f1c7204f
MD5 c33ac3773045cd3b1eb4a2585292bdbc
BLAKE2b-256 060194d6fe97d57ed024752dcebf325452fb6adc0035172f647fa8a2c2f5f093

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