{"id":19307414,"url":"https://github.com/artefactory/french-box-office","last_synced_at":"2025-06-29T23:35:34.783Z","repository":{"id":45655475,"uuid":"315357331","full_name":"artefactory/french-box-office","owner":"artefactory","description":"Predicting French movies success","archived":false,"fork":false,"pushed_at":"2021-12-02T08:20:40.000Z","size":22359,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-06T01:11:17.975Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artefactory.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}},"created_at":"2020-11-23T15:25:44.000Z","updated_at":"2021-11-17T14:29:42.000Z","dependencies_parsed_at":"2022-09-06T14:20:42.441Z","dependency_job_id":null,"html_url":"https://github.com/artefactory/french-box-office","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artefactory%2Ffrench-box-office","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artefactory%2Ffrench-box-office/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artefactory%2Ffrench-box-office/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artefactory%2Ffrench-box-office/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artefactory","download_url":"https://codeload.github.com/artefactory/french-box-office/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240409292,"owners_count":19796789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-10T00:10:50.949Z","updated_at":"2025-02-24T02:42:52.253Z","avatar_url":"https://github.com/artefactory.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# french-box-office\n\nPredicting French movies success\n\n## Install and Set up\n\nSet-up once and for all a dedicated conda environment:\n\n```bash\nconda create -y -n french_box_office python=3.7\nconda activate french_box_office\n```\n\nInstall then the requirements and export the path:\n\n```bash\npip install -r requirements.txt\nexport PYTHONPATH=\".\"\n```\n\n\n## Usage\n\n### Crawling movies sales\n\nFrench box-office statistics are gently crawled from the website [jpbox-office](http://jpbox-office.com) using [`scrapy`](https://scrapy.org/). You can refresh this data by typing the following commands:\n\n```bash\ncd lib/crawling/boxoffice\nscrapy crawl jpbox -a start_year=2000 -a end_year=2020 -o ../../../../data/french-box-office-23nov2020.json\n```\n\nIt will create the following `json`:\n\n```\n[\n    {\n        \"id\": \"17528\", // Source website id\n        \"year\": 2019, // Year of release\n        \"rank\": \"1\", // Rank in sales during the year of release\n        \"title\": \"Le Roi Lion (2019)\", // Movie title\n        \"total_sales\": 10017995, // Sales (nombre d'entrées) since release\n        \"release_date\": \"2019-07-17\", // Date of release in France\n        \"max_theaters_used\": 820, // Maximum number of theaters where the movie was screened during a week\n        \"first_screening_sales\": null, // Sales for the first screening (not always filled in)\n        \"first_day_sales\": 630478, // Sales on the first day\n        \"first_weekend_sales\": 2559370, // Sales on the first weekend\n        \"first_week_sales\": 3252896 // Sales on the week\n    },\n    ...\n]\n```\n\n### Getting movies features\n\nMovie features are extracted via [The Movie Database API](https://developers.themoviedb.org/3/getting-started/introduction). Create an account on their website and export your API key:\n\n```bash\nexport TMDB_API_KEY='your-key-here'\n```\n\nYou can then directly provide the previous \"sales\" json to the following script to get movie features:\n\n```bash\npython bin/get_movie_features.py --titles data/french-box-office-23nov2020.json --output data/movie-features-24nov2020.json\n```\n\nThe movie titles will be used as a query parameters to TMDb API. If we get a match, further details will be extracted from the API. A typical results will be like (original query and `id` are kept in the result):\n\n```\n[    \n    {\n        \"tmdb_id\": 2332,\n        \"adult\": false,\n        \"belongs_to_collection\": {\n            \"id\": 211721,\n            \"name\": \"Taxi - Saga\"\n        },\n        \"budget\": 0,\n        \"genres\": [\n            {\n                \"id\": 28,\n                \"name\": \"Action\"\n            },\n            {\n                \"id\": 35,\n                \"name\": \"Comédie\"\n            }\n        ],\n        \"imdb_id\": \"tt0183869\",\n        \"original_language\": \"fr\",\n        \"original_title\": \"Taxi 2\",\n        \"overview\": \"Daniel, le chauffeur de taxi dingue de vitesse, et Emilien, l'inspecteur de police inexpérimenté, se retrouvent à Paris. Le ministre de la défense japonais vient tester le savoir-faire hexagonal en matière de lutte antiterroriste et signer le contrat du siècle avec l'Etat français. Mais il est enlevé par des yakusas...\",\n        \"tmdb_popularity\": 12.892,\n        \"production_companies\": [\n            {\n                \"id\": 189,\n                \"name\": \"ARP Sélection\",\n                \"origin_country\": \"FR\"\n            },\n            {\n                \"id\": 356,\n                \"name\": \"TF1 Films Production\",\n                \"origin_country\": \"FR\"\n            },\n            {\n                \"id\": 104,\n                \"name\": \"Canal+\",\n                \"origin_country\": \"FR\"\n            },\n            {\n                \"id\": 121921,\n                \"name\": \"Leeloo Productions\",\n                \"origin_country\": \"\"\n            }\n        ],\n        \"production_countries\": [\n            {\n                \"iso_code\": \"FR\",\n                \"name\": \"France\"\n            }\n        ],\n        \"release_date\": \"2000-03-24\",\n        \"revenue\": 60726164,\n        \"runtime\": 88,\n        \"languages\": [\n            {\n                \"iso_code\": \"de\",\n                \"name\": \"Deutsch\"\n            },\n            {\n                \"iso_code\": \"fr\",\n                \"name\": \"Français\"\n            },\n            {\n                \"iso_code\": \"ja\",\n                \"name\": \"日本語\"\n            }\n        ],\n        \"status\": \"Released\",\n        \"tagline\": \"Attachez vos ceintures, il passe la seconde !\",\n        \"title\": \"Taxi 2\",\n        \"tmdb_vote_count\": 1113,\n        \"tmdb_vote_average\": 6.2,\n        \"cast\": [\n            {\n                \"adult\": false,\n                \"gender\": 2,\n                \"tmdb_id\": 20666,\n                \"name\": \"Samy Naceri\",\n                \"tmdb_popularity\": 6.409,\n                \"order\": 0\n            },\n            {\n                \"adult\": false,\n                \"gender\": 2,\n                \"tmdb_id\": 23943,\n                \"name\": \"Frédéric Diefenthal\",\n                \"tmdb_popularity\": 1.4,\n                \"order\": 1\n            },\n            {\n                \"adult\": false,\n                \"gender\": 1,\n                \"tmdb_id\": 8293,\n                \"name\": \"Marion Cotillard\",\n                \"tmdb_popularity\": 18.542,\n                \"order\": 2\n            },\n            {\n                \"adult\": false,\n                \"gender\": 1,\n                \"tmdb_id\": 23944,\n                \"name\": \"Emma Wiklund\",\n                \"tmdb_popularity\": 3.811,\n                \"order\": 3\n            },\n            ...\n        ],\n        \"id\": \"2398\",\n        \"query\": \"Taxi 2\"\n    },\n    ...\n]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartefactory%2Ffrench-box-office","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartefactory%2Ffrench-box-office","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartefactory%2Ffrench-box-office/lists"}