instant-data-scraper-utils/bin/process-stage-5.py
2024-07-16 18:08:36 -04:00

42 lines
1.2 KiB
Python
Executable file

#!/usr/bin/env python
# Script Name: process-stage-5
import os
import subprocess
from pyfiglet import Figlet
from halo import Halo
# Define the paths based on the project details
PROJECT_ROOT = "/home/ld/mgk-scrapes"
BIN_STAGE_5_DIR = os.path.join(PROJECT_ROOT, 'bin', 'stage-5')
BIN_DIR = os.path.join(PROJECT_ROOT, 'bin')
def run_scripts():
"""Run the specified scripts in order."""
scripts = [
os.path.join(BIN_STAGE_5_DIR, "prepare-stage-5.py"),
os.path.join(BIN_STAGE_5_DIR, "standardize-location-data.py"),
os.path.join(BIN_STAGE_5_DIR, "retrieve-root-domain.py"),
os.path.join(BIN_STAGE_5_DIR, "strip-brackets-from-review-count.py"),
]
# Run scripts that do not require arguments
for script in scripts:
subprocess.run(["python", script], check=True)
def main():
figlet = Figlet(font='slant')
script_name = "process-stage-5".replace("-", " ").title()
print(figlet.renderText(script_name))
print("Running scripts for Stage 5...\n")
run_scripts()
final_spinner = Halo(spinner='dots', color='green')
final_spinner.start()
final_spinner.succeed("All scripts completed.")
if __name__ == '__main__':
main()