celiao / tmdbsimple

A wrapper for The Movie Database API v3.
GNU General Public License v3.0
579 stars 122 forks source link

Modify get params to use api_key defined in params #85

Open harshulsahni opened 2 years ago

harshulsahni commented 2 years ago

the _get_params function only relied on tmdb.API_KEY = ... to set an API key. This PR aims to add functionality so that the user can specify an API key in every function to eliminate this global dependency.

See the test test_tmdb_get_params_no_api_with_search in test_base.py for example usage.

Also, this PR simplifies some boolean and string logic to for conciseness.

celiao commented 2 years ago

@harshulsahni Why do you want to use more than one API Key?

harshulsahni commented 2 years ago

@celiao I don't want to use more than one API key, but rather I would like the endpoint functions (e.g. search.movie()) to be used without having to define the API key at the top of some file. It would be much cleaner (in my opinion) to have the API key defined in the arguments of these functions so they can be more modular.