How arioberek/year-progress works
Project Overview and Purpose
• This project is a Python application called “Year Progress Tracker” that calculates the percentage of the year completed. It then generates a visual progress bar image and uploads it to Instagram—essentially automating the process of sharing a yearly progress update.
• The README outlines that the app handles three main tasks: calculating the year’s progress percentage, generating a visual progress bar, and interacting with Instagram (logging in and posting).
Analyzing the File Structure
• Top-Level Files and Folders:
• .env.example, README.md, and requirements.txt indicate configuration and dependency management.
• The .github directory with CI/CD workflow files (e.g., main.yml) suggests that there are automated testing/deployment processes.
• The src folder holds the core Python scripts.
• Within the src folder, we see key scripts:
• main.py: Likely the entry point that orchestrates the overall process.
• generate_progress_bar.py: Handles the creation of the visual progress bar image.
• ig_login.py: Deals with Instagram authentication.
• media_upload.py: Manages the image upload process.
• year_progress_percentage.py: Responsible for computing the percentage of the year that has passed.
• The utils subdirectory hints at supporting operations, like image-related utilities (e.g., get_image.py).
Main Components
• Calculation Module: Represented by year_progress_percentage.py. This component is responsible for computing the percentage progress of the year.
• Progress Bar Generation Module: Represented by generate_progress_bar.py (and possibly supported by functions in utils). This module takes the calculated percentage and produces a visual progress bar.
• Instagram Login Module: Represented by ig_login.py. It manages credential configuration (via environment variables or secure configuration) and logs into Instagram.
• Media Upload Module: Represented by media_upload.py. This handles posting the generated image to Instagram along with a caption.
• Utility Components: Located in the utils folder (e.g., get_image.py). They support image operations or other helper functionalities.
• External Elements:
• Instagram as an external service that receives the uploaded image.
• Python’s runtime environment and any external libraries/dependencies (as specified in requirements.txt).
Relationships and Interactions
• The main.py acts as the central orchestrator:
• It first uses the Calculation Module to determine the year’s percentage.
• Then, it invokes the Progress Bar Generation Module to create an image based on the computed percentage.
• Next, the Instagram Login Module is used for any necessary authentication.
• Finally, the Media Upload Module is called to post the image on Instagram.
• Data flows from the calculation stage to image generation, then to authentication, and finally to media upload—all as sequential steps.
Architectural Patterns and Design Principles
• The system appears to be built with a modular design where each component (calculation, image generation, authentication, upload) is encapsulated in its own script.
• The separation of concerns is evident, as each module handles a distinct part of the workflow. This modularity simplifies testing and future modifications.
• Although it’s a relatively simple application, the design might reflect aspects of the layered architecture seen in full-stack applications (i.e., processing, presentation, and external communication layers).