データパイプライン構成
フォルダ構成中級
データパイプラインプロジェクトは抽出、変換、ロード、分析といった複数のステージを含みます。明確な構造がなければ、Claude Codeはデータソースコネクターと変換関数を区別できません。このパターンはパイプラインステージを一貫した命名規則の別フォルダに分離し、Claudeが新しいデータソース、トランスフォーマー、出力先を追加するのを容易にします。
データETLパイプラインPython分析フォルダ構成
パターンコード
data-pipeline/
├── CLAUDE.md # Pipeline conventions
├── config/
│ ├── sources.yaml # Data source definitions
│ ├── destinations.yaml # Output target configs
│ └── schedules.yaml # Cron/scheduling config
├── src/
│ ├── extractors/ # Stage 1: Data extraction
│ │ ├── base.py # Abstract extractor class
│ │ ├── api_extractor.py # REST API sources
│ │ ├── db_extractor.py # Database sources
│ │ ├── csv_extractor.py # File-based sources
│ │ └── __init__.py
│ ├── transformers/ # Stage 2: Data transformation
│ │ ├── base.py # Abstract transformer
│ │ ├── clean.py # Data cleaning rules
│ │ ├── enrich.py # Data enrichment
│ │ ├── aggregate.py # Aggregation logic
│ │ └── __init__.py
│ ├── loaders/ # Stage 3: Data loading
│ │ ├── base.py # Abstract loader
│ │ ├── postgres_loader.py # PostgreSQL output
│ │ ├── bigquery_loader.py # BigQuery output
│ │ ├── csv_loader.py # CSV file output
│ │ └── __init__.py
│ ├── pipelines/ # Orchestration
│ │ ├── daily_sales.py # Full pipeline definitions
│ │ ├── weekly_report.py
│ │ └── __init__.py
│ ├── validators/ # Data quality checks
│ │ ├── schema_validator.py
│ │ └── quality_checks.py
│ └── utils/
│ ├── logging.py
│ └── metrics.py
├── tests/
│ ├── fixtures/ # Sample data for tests
│ │ ├── sample_sales.csv
│ │ └── sample_api_response.json
│ ├── test_extractors/
│ ├── test_transformers/
│ └── test_loaders/
├── data/ # Local data (gitignored)
│ ├── raw/ # Extracted raw data
│ ├── processed/ # Transformed data
│ └── output/ # Final output
├── requirements.txt
└── pyproject.toml
# CLAUDE.md excerpt:
# - Each stage (extract/transform/load) inherits from base.py.
# - New data source = new extractor + config in sources.yaml + test.
# - Transformers are composable — chain them in pipelines/.
# - data/ folder is gitignored. Use tests/fixtures/ for test data.
# - All extractors/loaders must handle connection retries.
# - Validators run between transform and load stages.
このパターンをプロジェクト設定にコピーして適用してください。
実行プレビュー
データパイプライン構成
データパイプライン構成について
Claude Codeパターンは、複雑な開発シナリオに対応するための実証済みアーキテクチャ設計とワークフロー構造です。データパイプライン構成は中級レベルのフォルダ構成パターンで、プロジェクトに合わせて応用できるテスト済みの再現可能なアプローチを提供し、より効率的で一貫した成果を実現します。