update character descriptions with actor names, update main characters list properly to contain all wanted characters, update CLI processing to use filters and copy keys more efficiently

This commit is contained in:
Xevion
2020-09-21 09:52:08 -05:00
parent 496f588f14
commit 8e3e293d76
3 changed files with 121 additions and 158 deletions

View File

@@ -402,8 +402,14 @@ def character():
for character, quotes in char_data.items(): for character, quotes in char_data.items():
final_data[character] = {'quotes': quotes, 'summary': None, 'name': None} final_data[character] = {'quotes': quotes, 'summary': None, 'name': None}
if character in descriptions.keys(): if character in descriptions.keys():
final_data[character]['name'] = descriptions[character].get('name') for key in ['name', 'summary', 'actor']:
final_data[character]['summary'] = descriptions[character].get('summary') final_data[character][key] = descriptions[character].get(key)
# Filter for main characters.
main_characters = list(map(character_id, load_file(os.path.join(DATA_DIR, 'main_characters.json'), True)))
for character in list(final_data.keys()):
if character not in main_characters:
del final_data[character]
# Save to characters.json # Save to characters.json
save_file(os.path.join(DATA_DIR, 'characters.json'), final_data, True) save_file(os.path.join(DATA_DIR, 'characters.json'), final_data, True)

View File

@@ -1,70 +1,137 @@
{ {
"michael": { "michael": {
"name": "Michael Scott", "name": "Michael Scott",
"summary": "Michael is the regional manager of Dunder Mifflin Paper Company in Scranton, Pennsylvania. Michael thinks of himself as an extremely capable boss who can handle any problem efficiently. In reality, Scott is ill-equipped to handle most of the problems that arise at Dunder Mifflin. Michael loves to host conference room meetings where typically very little is accomplished but he gets to be the center of attention. " "summary": "Michael is the regional manager of Dunder Mifflin Paper Company in Scranton, Pennsylvania. Michael thinks of himself as an extremely capable boss who can handle any problem efficiently. In reality, Scott is ill-equipped to handle most of the problems that arise at Dunder Mifflin. Michael loves to host conference room meetings where typically very little is accomplished but he gets to be the center of attention. ",
"actor": "Steve Carell"
}, },
"jim": { "jim": {
"name": "Jim Halpert", "name": "Jim Halpert",
"summary": "Jim is also in sales and is considered to be one of the \"heroes\" of the show because of his laid back attitude and ability to get along with people. During the course of the series, Jim marries Pam Beasley and subsequently becomes quite motivated to succeed as a paper salesman. There are many instances in The Office where Jim spends very little time attempting to increase his paper sales instead spending considerable time trying to win the affections of Pam. Jim also spends an inordinate amount of time playing tricks on Dwight or entertaining his co-workers which he primarily does to entertain Pam." "summary": "Jim is also in sales and is considered to be one of the \"heroes\" of the show because of his laid back attitude and ability to get along with people. During the course of the series, Jim marries Pam Beasley and subsequently becomes quite motivated to succeed as a paper salesman. There are many instances in The Office where Jim spends very little time attempting to increase his paper sales instead spending considerable time trying to win the affections of Pam. Jim also spends an inordinate amount of time playing tricks on Dwight or entertaining his co-workers which he primarily does to entertain Pam.",
"actor": "John Krakinski"
}, },
"pam": { "pam": {
"name": "Pam Beasley", "name": "Pam Beasley",
"summary": "Pam is the secretary at Dunder Mifflin and tries to keep Michael somewhat focused on work and being productive. Pam is unaware of Jim's romantic interest in her during the early seasons of the show." "summary": "Pam is the secretary at Dunder Mifflin and tries to keep Michael somewhat focused on work and being productive. Pam is unaware of Jim's romantic interest in her during the early seasons of the show.",
"actor": "Jenna Fischer"
}, },
"dwight": { "dwight": {
"name": "Dwight Schrute", "name": "Dwight Schrute",
"summary": "Dwight is unofficially the assistant (to the) regional manager at Dunder Mifflin. Dwight is extremely passionate about paper and is constantly trying to impress Michael. Dwight is also the leading salesman in the Scranton office." "summary": "Dwight is unofficially the assistant (to the) regional manager at Dunder Mifflin. Dwight is extremely passionate about paper and is constantly trying to impress Michael. Dwight is also the leading salesman in the Scranton office.",
"actor": "Rainn Wilson"
}, },
"stanley": { "stanley": {
"name": "Stanley Hudson", "name": "Stanley Hudson",
"summary": "Stanley is a fairly successful salesman who resents spending time in an office where he typically is not productive. Stanley tolerates Michael's long and typically pointless conference room meetings by spending his time completing crossword puzzles. " "summary": "Stanley is a fairly successful salesman who resents spending time in an office where he typically is not productive. Stanley tolerates Michael's long and typically pointless conference room meetings by spending his time completing crossword puzzles. ",
"actor": "Leslie David Baker"
}, },
"phyllis": { "phyllis": {
"name": "Phyllis Lapin", "name": "Phyllis Lapin",
"summary": "Phyllis is also a Dunder Mifflin salesperson. While Phyllis is typically very laid back and quiet she is very protective of her position in the company and her sales commissions. " "summary": "Phyllis is also a Dunder Mifflin salesperson. While Phyllis is typically very laid back and quiet she is very protective of her position in the company and her sales commissions.",
"actor": "Phyllis Smith"
}, },
"angela": { "angela": {
"name": "Angela Martin", "name": "Angela Martin",
"summary": "Angela is one of the lead accountants in The Office who has a tremendous affection for cats and tends to be a bit judgmental. Her no nonsense approach to how things should be done in the office appeals to Dwight." "summary": "Angela is one of the lead accountants in The Office who has a tremendous affection for cats and tends to be a bit judgmental. Her no nonsense approach to how things should be done in the office appeals to Dwight.",
"actor": "Angela Kinsey"
}, },
"oscar": { "oscar": {
"name": "Oscar Gutierrez", "name": "Oscar Gutierrez",
"summary": "Oscar is the other lead accountant in the office. Oscar and Angela frequently disagree about what is acceptable office behavior. " "summary": "Oscar is the other lead accountant in the office. Oscar and Angela frequently disagree about what is acceptable office behavior. ",
"actor": "Oscar Nuñez"
}, },
"kevin": { "kevin": {
"name": "Kevin Malone", "name": "Kevin Malone",
"summary": "Kevin is the third accountant in the office and he is less adept at accounting than one might expect. Kevin was given his job by Michael despite being under qualified and that helps to explain why he occasionally becomes confused about fairly simple concepts." "summary": "Kevin is the third accountant in the office and he is less adept at accounting than one might expect. Kevin was given his job by Michael despite being under qualified and that helps to explain why he occasionally becomes confused about fairly simple concepts.",
"actor": "Brian Baumgartner"
}, },
"creed": { "creed": {
"name": "Creed Bratton", "name": "Creed Bratton",
"summary": "Creed is ostensibly in charge of quality control for Dunder Mifflin paper. Creed is a highly unusual among the employees of Dunder Mifflin, showing a questionable history and affiliation with a complete lack of morals." "summary": "Creed is ostensibly in charge of quality control for Dunder Mifflin paper. Creed is a highly unusual among the employees of Dunder Mifflin, showing a questionable history and affiliation with a complete lack of morals.",
"actor": "Creed Bratton"
}, },
"meredith": { "meredith": {
"name": "Meredith Palmer", "name": "Meredith Palmer",
"summary": "Meredith is in \"supplier relations\" for Dunder Mifflin although she is seldom shown working on the show. Meredith spends most of her time playing solitaire on her computer. " "summary": "Meredith is in \"supplier relations\" for Dunder Mifflin although she is seldom shown working on the show. Meredith spends most of her time playing solitaire on her computer. ",
"actor": "Kate Flannery"
}, },
"andy": { "andy": {
"name": "Andy Bernard", "name": "Andy Bernard",
"summary": "Andy joined the sales staff at Dunder Mifflin after spending time at the Stamford Branch before it was closed due to downsizing. Andy did later become manager of Dunder Mifflin for a time, but for most of the series he acts as a salesman. His early appearances displayed him as a one-upping suckup employee with a tendency to loose one's temper. Andy is also unusually talented when it comes to singing, often boasting of his education at Cornell University in a capella group." "summary": "Andy joined the sales staff at Dunder Mifflin after spending time at the Stamford Branch before it was closed due to downsizing. Andy did later become manager of Dunder Mifflin for a time, but for most of the series he acts as a salesman. His early appearances displayed him as a one-upping suckup employee with a tendency to loose one's temper. Andy is also unusually talented when it comes to singing, often boasting of his education at Cornell University in a capella group.",
"actor": "Ed Helms"
}, },
"toby": { "toby": {
"name": "Toby Flenderson", "name": "Toby Flenderson",
"summary": "Toby is the head of human resources and he and Michael do not get along well. Toby frequently tries (with little success) to prevent Michael from violating corporate policy. As a result, Michael develops a strong grudge against Toby." "summary": "Toby is the head of human resources and he and Michael do not get along well. Toby frequently tries (with little success) to prevent Michael from violating corporate policy. As a result, Michael develops a strong grudge against Toby.",
"actor": "Paul Lieberstein"
}, },
"gabe": { "gabe": {
"name": "Gabe Lewis", "name": "Gabe Lewis",
"summary": "After Dunder Mifflin was taken over by Sabre Corporation, Gabe was assigned by the corporate headquarters to report on the activities at Scranton." "summary": "After Dunder Mifflin was taken over by Sabre Corporation, Gabe was assigned by the corporate headquarters to report on the activities at Scranton.",
"actor": "Zach Woods"
}, },
"kelly": { "kelly": {
"name": "Kelly Kapoor", "name": "Kelly Kapoor",
"summary": "Kelly Kapoor is in charge of customer relations at Dunder Mifflin Scranton. She is a very competent employee but she is extremely talkative and a bit of a gossip. She enjoys talking about trivial matters such as celebrity gossip and could certainly be accused of being obsessed about getting married (particularly to her on again off again boyfriend Ryan)." "summary": "Kelly Kapoor is in charge of customer relations at Dunder Mifflin Scranton. She is a very competent employee but she is extremely talkative and a bit of a gossip. She enjoys talking about trivial matters such as celebrity gossip and could certainly be accused of being obsessed about getting married (particularly to her on again off again boyfriend Ryan).",
"actor": "Mindy Kaling"
}, },
"ryan": { "ryan": {
"name": "Ryan Howard", "name": "Ryan Howard",
"summary": "Ryan Howard is a temporary employee in season one but eventually gets promoted to be Michaels supervisor at Dunder Mifflin." "summary": "Ryan Howard is a temporary employee in season one but eventually gets promoted to be Michaels supervisor at Dunder Mifflin.",
"actor": "B.J. Novak"
}, },
"erin": { "erin": {
"name": "Erin Hannon", "name": "Erin Hannon",
"summary": "Erin Hannon replaces Pam Beasley (Halpert) as the receptionist at Dunder Mifflin Scranton. Erin is cheerful and loves being a receptionist. She is typically positive and supportive of Michael which she demonstrates in the \"Nepotism\" scene. Erin could be described as the employee who is the least likely to quit her job in search of a better opportunity because she is very content at Dunder Mifflin." "summary": "Erin Hannon replaces Pam Beasley (Halpert) as the receptionist at Dunder Mifflin Scranton. Erin is cheerful and loves being a receptionist. She is typically positive and supportive of Michael which she demonstrates in the \"Nepotism\" scene. Erin could be described as the employee who is the least likely to quit her job in search of a better opportunity because she is very content at Dunder Mifflin.",
"actor": "Ellie Kemper"
},
"todd-packer": {
"name": "Todd Packer",
"summary": "",
"actor": "David Koechner"
},
"roy": {
"name": "Roy Anderson",
"summary": "",
"actor": "David Denman"
},
"jan": {
"name": "Jan Levinson",
"summary": "",
"actor": "Melora Hardin"
},
"karen": {
"name": "Karen Filippelli",
"summary": "",
"actor": "Rashida Jones"
},
"darryl": {
"name": "Darryl Philbin",
"summary": "",
"actor": "Craig Robinson"
},
"holly": {
"name": "Holly Flax",
"summary": "",
"actor": "Amy Ryan"
},
"pete": {
"name": "Pete Miller",
"summary": "",
"actor": "Jake Lacy"
},
"nellie": {
"name": "Nellie Bertram",
"summary": "",
"actor": "Catherine T"
},
"clark": {
"name": "Clark Green",
"summary": "",
"actor": "Clark Duke"
},
"david-wallace": {
"name": "David Wallace",
"summary": "",
"actor": ""
} }
} }

View File

@@ -1,139 +1,29 @@
Michael [
Dwight "Michael",
Jim "Dwight",
Pam "Jim",
Jan "Pam",
Ryan "Jan",
Angela "Ryan",
Kevin "Angela",
Toby "Kevin",
Oscar "Toby",
Phyllis "Oscar",
Kelly "Phyllis",
Roy "Kelly",
Stanley "Roy",
Andy "Stanley",
Karen "Andy",
Katy "Karen",
Creed "Creed",
Darryl "Darryl",
Carol "Meredith",
Meredith "Todd Packer",
Josh "Erin",
Todd Packer "Pete",
Martin "Clark",
David "Gabe",
Devon "David Wallace",
Bill "Robert California",
Hank "Holly Flax"
Sasha ]
Song
Brenda
Bob Vance
Linda
Dealer
KellysMom
Documentary CrewMember
Waitress
Video
Billy
Bob
JeromeBettis
Andy andJim
WarehouseWorker
Guy AtBar
Dwight andMichael
Kid
Vance Refrigeration Worker #2
LabTech
DeliveryWoman
MeredithsVet
Pretzelguy
KellysFather
Pam andJim
Albiny
WarehouseGuy
Everyone
Michael andChristian
Mark
Michael andJim
Liquor StoreClerk
Gil
Receptionist
Speaker
Overhead
Kids
MissTrudy
Chet
YoungMichael
DeliveryBoy
Hank the SecurityGuard
BillysGirlfriend
Andy &Michael
Chef
Cindy
Otherwaitress
Both
Jim:
Deleted Scene 3 Mr.Brown
TravelAgent
Teammates
Other Guy atBar
Employee
KevinsComputer
Warehouseguys
Man inVideo
Mr. OMalleyChildren
RyansVoicemail
Alyssa
Hostess
Girl actingPregnant
Actor
Actress
Kevin &Oscar
All
Phyllis
Meredith
Michael
Kevin
Darryl andKaty
Jim andPam
HootersGirls
Phylis
Pam andothers
Todd
Jimsvoicemail
Women
Men
Groupchant
All theMen
Dwight andRoy
Dan
Jim andDwight
TheKids
OfficeStaff
StoreEmployee
I.D.Photographer
Anglea
Femaleworker
Deleted Scene 1Michael
Ted
Waiter
Jim
Josh
andDwight
Ryan andothers
Announcer
CousinMose
Server
Girls
YoungMan
Mrs.Kapoor
Mr.Kapoor
Dwight
Michael
Michael
Malevoice
Michael &Dwight
Woman atbar
Andy and Michael