# wesjchen/time-series-pytest-framework architecture

> Architecture diagram of the GitHub repository wesjchen/time-series-pytest-framework, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wesjchen/time-series-pytest-framework
- Repository: https://github.com/wesjchen/time-series-pytest-framework

## Overview

This repository provides a CLI-driven QA framework for a time-series data warehouse: generate partitioned synthetic Parquet data, ingest it into PostgreSQL raw tables, then validate both the landing zone and warehouse data. The graph preserves the documented validation domains and all indexed storage and warehouse implementation modules. Validation details are documented, but individual test implementations were not excerpted; those links use README evidence.

Main entry points: [`tests`](https://github.com/wesjchen/time-series-pytest-framework/tree/main/tests) (QA test suite), [`src/ingest_to_raw.py`](https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/ingest_to_raw.py) (Raw ingestor), [`src/cloud_storage/__init__.py`](https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/cloud_storage/__init__.py) (Storage factory), [`src/main.py`](https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/main.py) (Pipeline CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Pipeline workflow"]
  node_cli["Pipeline CLI<br/>[main.py]"]
  node_generator["Synthetic generator"]
  node_ingestor["Raw ingestor<br/>[ingest_to_raw.py]"]
end

subgraph group_storage["Landing storage"]
  node_storage_factory["Storage factory<br/>[__init__.py]"]
  node_local["Local backend<br/>[local.py]"]
  node_s3["S3 backend<br/>[s3.py]"]
  node_gcs["GCS backend<br/>[gcs.py]"]
  node_azure["Azure backend<br/>[azure.py]"]
  node_parquet[("Partitioned Parquet")]
end

subgraph group_warehouse["Raw warehouse"]
  node_schema["Raw schema setup<br/>[schema.py]"]
  node_connection["Postgres access<br/>[connection.py]"]
  node_rawdb[("PostgreSQL raw tables")]
end

subgraph group_validation["QA validation"]
  node_qa_suite["QA test suite"]
  node_landing_checks["Landing-zone checks"]
  node_schema_checks["Schema contracts"]
  node_grain_checks["Counts and grain"]
  node_quality_checks["Nulls and outliers"]
  node_time_checks["Timestamp checks"]
  node_logic_checks["Business logic"]
end

node_engineer(("Engineer"))

node_engineer -->|"runs"| node_cli
node_cli -->|"dispatches"| node_generator
node_cli -->|"dispatches"| node_ingestor
node_cli -->|"runs tests"| node_qa_suite
node_generator -->|"gets backend"| node_storage_factory
node_storage_factory -->|"selects"| node_local
node_storage_factory -->|"selects"| node_s3
node_storage_factory -->|"selects"| node_gcs
node_storage_factory -->|"selects"| node_azure
node_generator -->|"writes partitions"| node_parquet
node_ingestor -->|"gets backend"| node_storage_factory
node_ingestor -->|"reads partitions"| node_parquet
node_ingestor -->|"ensures schema"| node_schema
node_schema -->|"executes DDL"| node_connection
node_ingestor -->|"opens connection"| node_connection
node_ingestor -->|"inserts rows"| node_rawdb
node_qa_suite -->|"includes"| node_landing_checks
node_qa_suite -->|"includes"| node_schema_checks
node_qa_suite -->|"includes"| node_grain_checks
node_qa_suite -->|"includes"| node_quality_checks
node_qa_suite -->|"includes"| node_time_checks
node_qa_suite -->|"includes"| node_logic_checks
node_landing_checks -->|"validates"| node_parquet
node_schema_checks -->|"validates"| node_rawdb
node_grain_checks -->|"validates"| node_rawdb
node_quality_checks -->|"validates"| node_rawdb
node_time_checks -->|"validates"| node_rawdb
node_logic_checks -->|"compares results"| node_rawdb

click node_cli "https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/main.py"
click node_generator "https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/generate_synthetic_data.py"
click node_ingestor "https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/ingest_to_raw.py"
click node_storage_factory "https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/cloud_storage/__init__.py"
click node_local "https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/cloud_storage/local.py"
click node_s3 "https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/cloud_storage/s3.py"
click node_gcs "https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/cloud_storage/gcs.py"
click node_azure "https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/cloud_storage/azure.py"
click node_schema "https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/warehouse/schema.py"
click node_connection "https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/warehouse/connection.py"
click node_qa_suite "https://github.com/wesjchen/time-series-pytest-framework/tree/main/tests"
click node_landing_checks "https://github.com/wesjchen/time-series-pytest-framework/tree/main/tests"
click node_schema_checks "https://github.com/wesjchen/time-series-pytest-framework/tree/main/tests"
click node_grain_checks "https://github.com/wesjchen/time-series-pytest-framework/tree/main/tests"
click node_quality_checks "https://github.com/wesjchen/time-series-pytest-framework/tree/main/tests"
click node_time_checks "https://github.com/wesjchen/time-series-pytest-framework/tree/main/tests"
click node_logic_checks "https://github.com/wesjchen/time-series-pytest-framework/tree/main/tests"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_generator,node_ingestor toneBlue
class node_storage_factory,node_local,node_s3,node_gcs,node_azure,node_parquet toneAmber
class node_schema,node_connection,node_rawdb toneMint
class node_qa_suite,node_landing_checks,node_schema_checks,node_grain_checks,node_quality_checks,node_time_checks,node_logic_checks toneRose
class node_engineer toneIndigo
```

## Components

### Pipeline workflow

- [Pipeline CLI](https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/main.py): `src/main.py`
- [Synthetic generator](https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/generate_synthetic_data.py): `src/generate_synthetic_data.py`
- [Raw ingestor](https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/ingest_to_raw.py): `src/ingest_to_raw.py`

### Landing storage

- [Storage factory](https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/cloud_storage/__init__.py): `src/cloud_storage/__init__.py`
- [Local backend](https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/cloud_storage/local.py): `src/cloud_storage/local.py`
- [S3 backend](https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/cloud_storage/s3.py): `src/cloud_storage/s3.py`
- [GCS backend](https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/cloud_storage/gcs.py): `src/cloud_storage/gcs.py`
- [Azure backend](https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/cloud_storage/azure.py): `src/cloud_storage/azure.py`
- **Partitioned Parquet**

### Raw warehouse

- [Raw schema setup](https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/warehouse/schema.py): `src/warehouse/schema.py`
- [Postgres access](https://github.com/wesjchen/time-series-pytest-framework/blob/main/src/warehouse/connection.py): `src/warehouse/connection.py`
- **PostgreSQL raw tables**

### QA validation

- [QA test suite](https://github.com/wesjchen/time-series-pytest-framework/tree/main/tests): `tests`
- [Landing-zone checks](https://github.com/wesjchen/time-series-pytest-framework/tree/main/tests): `tests`
- [Schema contracts](https://github.com/wesjchen/time-series-pytest-framework/tree/main/tests): `tests`
- [Counts and grain](https://github.com/wesjchen/time-series-pytest-framework/tree/main/tests): `tests`
- [Nulls and outliers](https://github.com/wesjchen/time-series-pytest-framework/tree/main/tests): `tests`
- [Timestamp checks](https://github.com/wesjchen/time-series-pytest-framework/tree/main/tests): `tests`
- [Business logic](https://github.com/wesjchen/time-series-pytest-framework/tree/main/tests): `tests`

### Other components

- **Engineer**

## Connections

- Engineer → Pipeline CLI: runs (evidence: `README.md`)
- Pipeline CLI → Synthetic generator: dispatches (evidence: `src/main.py`)
- Pipeline CLI → Raw ingestor: dispatches (evidence: `src/main.py`)
- Pipeline CLI → QA test suite: runs tests (evidence: `src/main.py`)
- Synthetic generator → Storage factory: gets backend (evidence: `src/generate_synthetic_data.py`)
- Storage factory → Local backend: selects (evidence: `src/cloud_storage/__init__.py`)
- Storage factory → S3 backend: selects (evidence: `src/cloud_storage/__init__.py`)
- Storage factory → GCS backend: selects (evidence: `src/cloud_storage/__init__.py`)
- Storage factory → Azure backend: selects (evidence: `src/cloud_storage/__init__.py`)
- Synthetic generator → Partitioned Parquet: writes partitions (evidence: `README.md`)
- Raw ingestor → Storage factory: gets backend (evidence: `src/ingest_to_raw.py`)
- Raw ingestor → Partitioned Parquet: reads partitions (evidence: `src/ingest_to_raw.py`)
- Raw ingestor → Raw schema setup: ensures schema (evidence: `src/ingest_to_raw.py`)
- Raw schema setup → Postgres access: executes DDL (evidence: `src/warehouse/schema.py`)
- Raw ingestor → Postgres access: opens connection (evidence: `src/ingest_to_raw.py`)
- Raw ingestor → PostgreSQL raw tables: inserts rows (evidence: `src/ingest_to_raw.py`)
- QA test suite → Landing-zone checks: includes (evidence: `README.md`)
- QA test suite → Schema contracts: includes (evidence: `README.md`)
- QA test suite → Counts and grain: includes (evidence: `README.md`)
- QA test suite → Nulls and outliers: includes (evidence: `README.md`)
- QA test suite → Timestamp checks: includes (evidence: `README.md`)
- QA test suite → Business logic: includes (evidence: `README.md`)
- Landing-zone checks → Partitioned Parquet: validates (evidence: `README.md`)
- Schema contracts → PostgreSQL raw tables: validates (evidence: `README.md`)
- Counts and grain → PostgreSQL raw tables: validates (evidence: `README.md`)
- Nulls and outliers → PostgreSQL raw tables: validates (evidence: `README.md`)
- Timestamp checks → PostgreSQL raw tables: validates (evidence: `README.md`)
- Business logic → PostgreSQL raw tables: compares results (evidence: `README.md`)
