Input from a text file, pull from multiple APIs, formatting output, etc. in Python

tomf
Tue, 09 Feb 2021 00:26:12 +0000

I don't need answers so much as an idea of where to start.

Essentially, I have a Google Sheet that uses importjson.gs to pull from the following APIs

OMDB (IMDB)

TheMovieDB

TVMaze

I also use another script to scrape Letterboxd for ratings.

This works well, but sometimes it'll time out or I'll hit urlFetch limits that Google has in place.

Basically, I'd like to have a text file (input.txt) where I pop in a bunch of titles and year or IMDB IDs, then the script runs and pulls set endpoints from all of these, outputting everything on one line (a pipe as a delimiter.)

My thinking is that I can then pull that info a sheet and run all of the formatting, basic math, and whatever else so it suits my Sheet.

I have a feeling I'll be using requests for the JSON and beautifulsoup for letterboxd -- or maybe a module.

Can anyone point me in the right direction? I don't think it'll be too difficult and should work well for a first python project.

Comments URL: https://tildes.net/~comp/v2r/input_from_a_text_file_pull_from_multiple_apis_formatting_output_etc_in_python

Votes: 7

Comments: 8