![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
|PyPI Version| |PyPI License| |Code style: black|
tmdb-python, an async Python library for TMDb API.
Overview <#overview>
__Getting started <#getting-started>
__Configuration <#configuration>
__The tmdb-python is an asynchronous wrapper, written in Python, for The Movie Database (TMDb) API v3.
The Movie Database (TMDB) <https://www.themoviedb.org>
__ is a
community built movie and TV database.
The TMDB API <https://www.themoviedb.org/documentation/api>
__ service
is for those of you interested in using our movie, TV show or actor
images and/or data in your application.
A TMDB user account <https://www.themoviedb.org/account/signup>
__ is
required to request an API key.
python
(Python >=3.9)pip
(Python package manager)The easiest way to install tmdb-python is via pip
.
::
pip install tmdb-python
You will need an API key to The Movie Database to access the API. To obtain a key, follow these steps:
Register <https://www.themoviedb.org/account/signup>
__ for and
verify an account.Log <https://www.themoviedb.org/login>
__ into your account.API section <https://www.themoviedb.org/settings/api>
__
on left side of your account page.The first step is to initialize a TMDB object and set your API Key.
.. code:: py
import asyncio
from tmdb import route, schema
async def main():
base = route.Base()
base.key = "YOUR_API_KEY"
movies = await route.Movie().search("fight club")
for movie in movies:
print(movie["name"])
movies = movies.to(schema.Movies) # convert `dict` to `schema.Movies`
for movie in movies:
print(movie.name)
asyncio.run(main())
Alternatively, you can export your API key as an environment variable.
.. code:: bash
$ export TMDB_KEY="YOUR_API_KEY"
And then you will no longer need to set your API key.
.. code:: py
import asyncio
from tmdb import route
async def main():
# implicit env var: TMDB_KEY="YOUR_API_KEY"
movies = await route.Movie().popular()
for movie in movies:
print(movie["name"])
asyncio.run(main())
For more information, see the docs <https://leandcesar.github.io/tmdb-python/>
__.
Initialize a TMDB object and set your API Key, language and region.
.. code:: py
from tmdb import route
async def main():
base = route.Base()
base.key = "YOUR_API_KEY"
base.language = "pt-BR"
base.region = "BR"
providers = await route.Movie().providers_list()
Alternatively, you can export your API key, language and region logger as an environment variable.
.. code:: bash
$ export TMDB_KEY="YOUR_API_KEY"
$ export TMDB_LANGUAGE="pt-BR" # ISO 639-1
$ export TMDB_REGION="BR" # ISO-3166-1
And then you will no longer need to set your API key, language and region.
.. code:: py
async def main():
# implicit env vars: TMDB_KEY="YOUR_API_KEY" TMDB_LANGUAGE="pt-BR" TMDB_REGION="BR"
providers = await route.Movie().providers_list()
You also can set language and region on object instantiation.
.. code:: py
async def main():
# implicit env vars: TMDB_KEY="YOUR_API_KEY" TMDB_LANGUAGE="pt-BR" TMDB_REGION="BR"
movies = await route.Movie().discover() # discover with the BR regional release date
movies = await route.Movie(language="en-US", region="US").discover() # discover with the US regional release date
.. |Code style: black| image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black .. |PyPI Version| image:: https://img.shields.io/pypi/v/tmdb-python?color=blue :target: https://pypi.org/project/tmdb-python/ .. |PyPI License| image:: https://img.shields.io/pypi/l/tmdb-python.svg :target: https://img.shields.io/pypi/l/tmdb-python.svg
FAQs
Asynchronous Python library for The Movie Database (TMDB) API v3
We found that tmdb-python demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.