{"id":37719027,"url":"https://github.com/marouenes/imdb-rating-classifier","last_synced_at":"2026-01-20T16:41:37.207Z","repository":{"id":65370541,"uuid":"590541112","full_name":"marouenes/imdb-rating-classifier","owner":"marouenes","description":"Application that scrapes data from IMDB and adjusts ratings based on some rules.","archived":false,"fork":false,"pushed_at":"2025-10-31T19:47:12.000Z","size":156,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-31T21:20:37.043Z","etag":null,"topics":["imdb-api","rating-system","web-scraping"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marouenes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-01-18T16:46:18.000Z","updated_at":"2023-01-19T21:19:54.000Z","dependencies_parsed_at":"2023-02-12T10:46:42.393Z","dependency_job_id":null,"html_url":"https://github.com/marouenes/imdb-rating-classifier","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/marouenes/imdb-rating-classifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marouenes%2Fimdb-rating-classifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marouenes%2Fimdb-rating-classifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marouenes%2Fimdb-rating-classifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marouenes%2Fimdb-rating-classifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marouenes","download_url":"https://codeload.github.com/marouenes/imdb-rating-classifier/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marouenes%2Fimdb-rating-classifier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["imdb-api","rating-system","web-scraping"],"created_at":"2026-01-16T13:30:51.977Z","updated_at":"2026-01-16T13:30:52.256Z","avatar_url":"https://github.com/marouenes.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IMDB rating classifier\n\n[![Documentation Status](https://readthedocs.org/projects/imdb-rating-classifier/badge/?version=latest)](https://imdb-rating-classifier.readthedocs.io/en/latest/?badge=latest)\n[![main](https://github.com/marouenes/imdb-rating-classifier/actions/workflows/main.yml/badge.svg)](https://github.com/marouenes/imdb-rating-classifier/actions/workflows/main.yml)\n![PyPI](https://img.shields.io/pypi/v/imdb-rating-classifier)\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Testing](#testing)\n- [CI/CD](#cicd)\n- [TODO](#todo)\n- [License](#license)\n- [Author](#author)\n\nThis is a simple [IMDB rating classifier](https://imdb-rating-classifier.readthedocs.io/en/latest/) application that panalizes reviews in accordance with some pre-defined ruleset.\n\n## Overview\n\nThe application scrapes data from [IMDB](https://www.imdb.com/chart/top/) and adjusts the rating system according to some specific validation rules (review penalization).\n\nThe data is scraped from the IMDB charts API using the [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/) library.\n\nThe data structure of the parsed and normalized payload is as follows (example):\n\n```json\n{\n  \"rank\": \"1\",\n  \"title\": \"The Shawshank Redemption\",\n  \"year\": \"1994\",\n  \"rating\": \"9.2\",\n  \"votes\": \"2,223,000\",\n  \"url\": \"/title/tt0111161/\",\n  \"oscars_won\": 0,\n  \"penalized\": false\n}\n```\n\nWe would then, extract the following fields, into a dataframe:\n\n```python\n- rank (int)\n- title (str)\n- year (int)\n- rating (float)\n- votes (int)\n- url (str)\n- oscars_won (int)\n- penalized (bool)\n```\n\nUsing dataclasses, we can then, preprocess the data against some schema definition.\n\nThe rules are as follows:\n\n```python\nschema = {\n    \"rank\": {\n        \"type\": \"int\",\n        \"min\": 1,\n        \"max\": 250,\n        \"required\": True,\n    },\n    \"title\": {\n        \"type\": \"str\",\n        \"required\": True,\n    },\n    \"year\": {\n        \"type\": \"int\",\n        \"min\": 1900,\n        \"max\": 2023,\n        \"required\": True,\n    },\n    \"rating\": {\n        \"type\": \"float\",\n        \"min\": 0.0,\n        \"max\": 10.0,\n        \"required\": True,\n    },\n    \"votes\": {\n        \"type\": \"int\",\n        \"min\": 0,\n        \"required\": True,\n    },\n    \"url\": {\n        \"type\": \"str\",\n        \"required\": True,\n    },\n    \"oscars_won\": {\n        \"type\": \"int\",\n        \"min\": 0,\n        \"required\": True,\n    },\n    \"penalized\": {\n        \"type\": \"bool\",\n        \"required\": True,\n    },\n}\n```\n\n## Requirements\n\n- Python\u003e=3.8\u003e=3.10\n- BeautifulSoup4\n- requests\n- pytest\n- tox\n- click\n- pre-commit\n- flake8\n- black\n- isort\n\nand more...\n\n## Installation\n\nFor development purposes:\n\n- Clone the repository\n\n  ```console\n  foo@bar:~$ git clone git@github.com/marouenes/imdb-rating-classifier.git\n  ```\n\n- Create a virtual environment\n\n  ```console\n  foo@bar:~/imdb-rating-classifier$ virtualenv .venv\n  ```\n\n- Activate the virtual environment\n\n  ```console\n  foo@bar:~/imdb-rating-classifier$ source .venv/bin/activate\n  ```\n\n- Install the dev dependencies\n\n  ```console\n  foo@bar:~/imdb-rating-classifier$ pip install -r requirements-dev.txt\n  ```\n\n- Install the pre-commit hooks\n\n  ```console\n  foo@bar:~/imdb-rating-classifier$ pre-commit install\n  ```\n\nFor usage:\n\n- Install the dependencies and build the wheel\n\n  ```console\n  foo@bar:~/imdb-rating-classifier$ pip install -e .\n  ```\n\nThe application is publicly available and published on [PyPI](https://pypi.org/project/imdb-rating-classifier/) and can be installed using pip:\n\n```console\nfoo@bar:~$ pip install imdb-rating-classifier\n```\n\n## Usage\n\n- Display the help message and the available commands\n\n```console\nfoo@bar:~$ imdb-rating-classifier generate --help\nUsage: imdb-rating-classifier generate [OPTIONS]\n\n  Generate the output dataset containing both the original and adjusted\n  ratings.\n\n  An extra JSON file will be generated alongside the csv file\n\nOptions:\n  --output FILE               The path to the output file.\n  --number-of-movies INTEGER  The number of movies to scrape.\n  -h, --help                  Show this message and exit.\n```\n\n- Run the application with the default number of movies (20) and the default output file (data.csv)\n\n```bash\nimdb-rating-classifier generate\n```\n\n- Run the application with a specific number of movies\n\n```bash\nimdb-rating-classifier generate --number-of-movies 100\n```\n\n- Run the application with a specific number of movies and a specific output file\n\n```bash\nimdb-rating-classifier generate --number-of-movies 100 --output some_name.csv\n```\n\n## Testing\n\n- Run tests and pre-commit hooks\n\n```console\nfoo@bar:~/imdb-rating-classifier$ tox\n```\n\n## CI/CD\n\nThe application is automatically packaged and distributed to PyPI, It is also automatically\ntested using tox as an environment orchestrator and GitHub Actions.\n\n## TODO\n\n- [X] Add more tests\n- [X] Add more validation rules\n- [X] Add more documentation\n- [ ] Add more features!\n- [X] Add a readthedocs page\n- [ ] Describe code in readthedocs\n- [X] Publish the package on PyPI\n- [X] Add oscar awards or nominations for the movies\n- [X] Add a version switch for the cli\n\n## License\n\nMIT License\n\n## Author\n\n[Marouane Skandaji](mailto:marouane.skandaji@gmail.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarouenes%2Fimdb-rating-classifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarouenes%2Fimdb-rating-classifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarouenes%2Fimdb-rating-classifier/lists"}