How manudelaguila/tealiumapi works
Main Components
• Environment & Dependency Management: There is a requirements.txt along with instructions to create and use a Python virtual environment.
• Version-Specific Modules: Two distinct directories (v2 and v3) for handling the respective versions of the Tealium API.
• Configuration Files: Each version directory contains an example token file (tealiumTokenV2_example.json and tealiumTokenV3_example.json) that should be copied and renamed as tealiumTokenV2.json or tealiumTokenV3.json. These files provide the necessary API configuration details (API key, email, account, etc.).
• API Client Modules: The Python scripts (tealium_api_v2.py and tealium_api_v3.py) encapsulate the logic to interact with the Tealium API.
Relationships and Interactions
• The User sets up the environment, installs dependencies from requirements.txt, and edits the configuration files to include valid credentials.
• The API client modules (one for V2 and one for V3) read the corresponding configuration (token) files.
• These modules then establish communication with the external Tealium API endpoints, performing actions as specified (e.g., retrieving version details, updating load rules).
• There is a clear separation between the two API versions, which allows for isolated error tracking (as noted in the README) and potentially parallel development or testing.
Architectural Patterns and Technologies
• Modularity: Different API versions are handled in separate directories, promoting separation of concerns.
• Configuration Over Convention: The use of JSON token files to configure the API interactions, permitting flexibility.
• External Integration: The system solely acts as an intermediary for API calls to Tealium, which means that its primary responsibility is to correctly format requests and handle API responses.
• Python Virtual Environment & Dependency Management: Standard best practices for managing dependencies in Python are highlighted.