How spiral023/plexport works
Main Components
• Installation Module: Represented by the install.bat script, which performs environment checks, downloads the main PLEXport.py script, installs dependencies (pandas, plexapi, openpyxl), and finally starts the application.
• Core Application Module: The main PLEXport.py script, which encapsulates all primary functionalities.
• Data Sources:
• Local Mode: A Plex database file (e.g., .db) that contains historical Plex data.
• Live Mode: A Plex server accessed via the plexapi, using Base URL and token for authentication.
• Data Processing & Export:
• Data Extraction: Functions within PLEXport.py that extract and possibly transform data from either the local database or live API responses.
• Excel Creation: Use of pandas and openpyxl to generate Excel files from the extracted data.
• Excel Comparison: Module or functions that compare two Excel exports to report differences.
• User Interface: The GUI window that opens after installation and script execution. This interface guides the user through selecting mediatheks, choosing between film or series data, and performing comparisons or statistical analyses.
Relationships and Data Flow
• The process starts with the Installation Module. It verifies Python is installed, then automatically downloads and prepares the environment.
• Once initiated, the Core Application Module (PLEXport.py) handles both the extraction and the export procedures.
• Depending on the mode selected, data will flow:
• In DB Mode, data is read from a local Plex database.
• In Live Mode, a connection is made to a Plex server via the plexapi and then related data is fetched.
• Extracted data is processed using pandas, then passed to the Excel export component via openpyxl.
• If the Excel Comparison feature is triggered, the application takes two Excel files as input, compares them, and outputs the differences and statistics to the user.
• The User Interface serves as both the control panel for these processes and the visualization point for statistics and help guides.
Design Patterns & Technologies
• Although the project is "monolithic" (a single main Python script orchestrating all functions), there is a logical separation of concerns:
• Installation and environment setup are handled externally.
• Data Access (local DB and live API interaction) is clearly delineated.
• Data transformation and output (Excel generation and comparison) is managed in dedicated code segments.
• Technologies and libraries include Python along with pandas for data manipulation, plexapi for live API interaction with Plex, and openpyxl for creating Excel files.