-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
30 lines (23 loc) · 804 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""
Title : main
Author : Dimitra Paraskevopoulou
Created : 06 December 2020
"""
from scraper import StarWarsScraper
from utils import Utils
import logging
logging.basicConfig(level=logging.INFO)
if __name__ == "__main__":
scraper = StarWarsScraper()
utils = Utils()
# Get the 10 characters which appear in the most films
characters, top_appearances = scraper.get_people(scraper.people_uri)
# Get each character species
characters = scraper.get_species(characters)
# Sort the list with the characters per height
characters = utils.sort_by_height(characters)
# Output the list of characters to a csv file
utils.output_results(characters)
# Send CSV file to httpbin.org
utils.send_csv()
logging.info("Exercise was successfully executed!")