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 to test on local machine

from filmsdk_ibrahim import MovieClient, MovieConfig

# Configuration with your API URL (local via docker)
config = MovieConfig(movie_base_url="http://localhost:5050")
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")

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.4.tar.gz (4.2 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.4-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: filmsdk_ibrahim-0.0.4.tar.gz
  • Upload date:
  • Size: 4.2 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.4.tar.gz
Algorithm Hash digest
SHA256 b1b3937c46bb09f17e55a21c970027ec3ba25bb9be046898c88dda179c3d5835
MD5 ac93c1be88b6867ef0660de2f7516535
BLAKE2b-256 ce00e00de4963fbf2046f3e3aafa7a56a8939413f803c4c99b4b47ee39d0fe17

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for filmsdk_ibrahim-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d150b53c97626ff1d9940c4833a889cd40036711926e7f89051cea3497f7d119
MD5 fc9fb7e80239259044a1d14e408cdecc
BLAKE2b-256 91786367537796e250ff82b110d09849e1fde758b79e2665082268e80a9880ea

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