{"id":18715672,"url":"https://github.com/leandcesar/themoviedb","last_synced_at":"2025-04-15T14:46:29.307Z","repository":{"id":57475977,"uuid":"458939723","full_name":"leandcesar/themoviedb","owner":"leandcesar","description":"A modern and easy to use API wrapper for The Movie Database (TMDb) API v3 written in Python.","archived":false,"fork":false,"pushed_at":"2024-07-23T02:01:36.000Z","size":3036,"stargazers_count":41,"open_issues_count":13,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T05:17:18.146Z","etag":null,"topics":["python","themoviedb","tmdb"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/themoviedb","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/leandcesar.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2022-02-13T21:44:19.000Z","updated_at":"2025-03-25T19:01:14.000Z","dependencies_parsed_at":"2024-07-21T01:22:39.261Z","dependency_job_id":"80717190-ac5f-4725-b1e0-1ffac8e4ca23","html_url":"https://github.com/leandcesar/themoviedb","commit_stats":{"total_commits":51,"total_committers":2,"mean_commits":25.5,"dds":"0.039215686274509776","last_synced_commit":"7879120fb550f17741d3f8b26add27549e7ed192"},"previous_names":["leandcesar/tmdb-python"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandcesar%2Fthemoviedb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandcesar%2Fthemoviedb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandcesar%2Fthemoviedb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandcesar%2Fthemoviedb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leandcesar","download_url":"https://codeload.github.com/leandcesar/themoviedb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249093817,"owners_count":21211785,"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":["python","themoviedb","tmdb"],"created_at":"2024-11-07T13:09:30.105Z","updated_at":"2025-04-15T14:46:29.288Z","avatar_url":"https://github.com/leandcesar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"|Code Coverage| |PyPI Version| |Code style: black| |PyPI License|\n\nthemoviedb\n==========\n\nA modern and easy to use API wrapper for The Movie Database (TMDb) API v3\nwritten in Python. Supports sync and async requests!\n\n.. image:: https://github.com/leandcesar/themoviedb/blob/master/docs/assets/themoviedb.gif?raw=true\n   :target: https://github.com/leandcesar/themoviedb\n   :alt: themoviedb\n\nOverview\n========\n\nThe **themoviedb** is a synchronous and asynchronous wrapper, written in Python,\nfor The Movie Database (TMDb) API v3.\n\n`The Movie Database (TMDb) \u003chttps://www.themoviedb.org\u003e`__ is a\ncommunity built movie and TV database.\n\nThe `TMDb API \u003chttps://www.themoviedb.org/documentation/api\u003e`__ service\nis for those of you interested in using our movie, TV show or actor\nimages and/or data in your application.\n\nA `TMDb user account \u003chttps://www.themoviedb.org/account/signup\u003e`__ is\nrequired to request an API key.\n\nGetting started\n===============\n\nRequirements\n------------\n\n-  ``python`` (Python \u003e=3.8)\n-  ``pip`` (Python package manager)\n\nInstall\n-------\n\nThe easiest way to install **themoviedb** is via ``pip``.\n\n.. code-block:: shell\n\n    pip install themoviedb[full]\n\nOr only the sync version (with ``requests``).\n\n.. code-block:: shell\n\n    pip install themoviedb[sync]\n\nOr only the async version (with ``aiohttp``).\n\n.. code-block:: shell\n\n    pip install themoviedb[async]\n\nAPI Key\n-------\n\nYou will need an API key to The Movie Database to access the API. To\nobtain a key, follow these steps:\n\n1. `Register \u003chttps://www.themoviedb.org/account/signup\u003e`__ for and\n   verify an account.\n2. `Log \u003chttps://www.themoviedb.org/login\u003e`__ into your account.\n3. Select the `API section \u003chttps://www.themoviedb.org/settings/api\u003e`__\n   on left side of your account page.\n4. Click on the link to generate a new API key and follow the\n   instructions.\n\nUsage\n=====\n\nSync mode\n---------\n\n.. code:: python\n\n    from themoviedb import TMDb\n\nAsync mode\n----------\n\n.. code:: python\n\n    from themoviedb import aioTMDb\n\nConfiguration\n-------------\n\nInitialize a TMDb object and set your API Key, language and region.\n\n.. code:: python\n\n    tmdb = TMDb(key=\"YOUR_API_KEY\", language=\"pt-BR\", region=\"BR\")\n    # or: tmdb = aioTMDb(key=\"YOUR_API_KEY\", language=\"pt-BR\", region=\"BR\")\n\nAlternatively, set after initialize.\n\n.. code:: python\n\n    tmdb = TMDb()\n    # or: tmdb = aioTMDb()\n    tmdb.key = \"YOUR_API_KEY\"\n    tmdb.language = \"pt-BR\"     # default: en-US\n    tmdb.region = \"BR\"          # default: US\n\nAlternatively too, you can export your API key, language and region\nlogger as an environment variable.\n\n.. code:: bash\n\n    $ export TMDB_KEY=\"YOUR_API_KEY\"\n    $ export TMDB_LANGUAGE=\"pt-BR\"  # ISO 639-1\n    $ export TMDB_REGION=\"BR\"       # ISO-3166-1\n\nAnd then you will no longer need to set your API key, language and region.\n\n.. code:: python\n\n    tmdb = TMDb()   # from env: TMDB_KEY=\"YOUR_API_KEY\", TMDB_LANGUAGE=\"pt-BR\", TMDB_REGION=\"BR\"\n    # or: tmdb = aioTMDb()\n\nExamples\n--------\n\nGet the list of top rated movies (sync mode).\n\n.. code:: python\n\n    from themoviedb import TMDb\n\n    tmdb = TMDb()\n    movies = tmdb.movies().top_rated()\n    for movie in movies:\n        print(movie)\n\nGet the list of popular TV shows (async mode).\n\n.. code:: python\n\n    import asyncio\n    from themoviedb import aioTMDb\n\n    async def main():\n        tmdb = aioTMDb()\n        movies = await tmdb.tvs().popular()\n        for movie in movies:\n            print(movie)\n\n    asyncio.run(main())\n\nDiscover movies by different types of data.\n\n.. code:: python\n\n    from themoviedb import TMDb\n\n    tmdb = TMDb()\n    movies = tmdb.discover().movie(\n        sort_by=\"vote_average.desc\",\n        primary_release_date__gte=\"1997-08-15\",\n        vote_count__gte=10000,\n        vote_average__gte=6.0,\n    )\n    for movie in movies:\n        print(movie)\n\nGet the details of movie for a search.\n\n.. code:: python\n\n    import asyncio\n    from themoviedb import aioTMDb\n\n    async def main():\n        tmdb = aioTMDb()\n        movies = await tmdb.search().movies(\"fight club\")\n        movie_id = movies[0].id  # get first result\n        movie = await tmdb.movie(movie_id).details(append_to_response=\"credits,external_ids,images,videos\")\n        print(movie.title, movie.year)\n        print(movie.tagline)\n        print(movie.poster_url)\n        print(movie.external_ids.imdb_url)\n        for person in movie.credits.cast:\n            print(person.name, person.character)\n\n    asyncio.run(main())\n\n.. |Code Coverage| image:: https://codecov.io/gh/leandcesar/themoviedb/branch/master/graph/badge.svg?token=OOILIE0RTS\n   :target: https://codecov.io/gh/leandcesar/themoviedb\n.. |Code style: black| image:: https://img.shields.io/badge/code%20style-black-000000.svg\n   :target: https://github.com/psf/black\n.. |PyPI Version| image:: https://img.shields.io/pypi/v/themoviedb?color=blue\n   :target: https://pypi.org/project/themoviedb/\n.. |PyPI License| image:: https://img.shields.io/pypi/l/themoviedb.svg\n   :target: https://img.shields.io/pypi/l/themoviedb.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleandcesar%2Fthemoviedb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleandcesar%2Fthemoviedb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleandcesar%2Fthemoviedb/lists"}