A comprehensive, config-driven data ingestion library for Python
Project description
Config-Driven Data Loading Framework
Framework that eliminates repetitive data loading code by using configuration files. Instead of writing custom code for each data source, we configure once and reuse everywhere.
Framework Architecture
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ DATA SOURCES │ │ ORCHESTRATOR │ │ Database │
│ │ │ │ │ Schema │
│ • CSV Files │────│ Config Reader │────│ │
│ • Excel Files │ │ Data Processor │ │ • api_data │
│ • REST APIs │ │ Column Mapper │ │ • market_trends │
│ • JSON Files │ │ Database Writer │ │ • risk_metrics │
└─────────────────┘ └──────────────────┘ └─────────────────┘
Core Components
- DataSourceFactory: Creates appropriate loaders based on configuration type
- DataOrchestrator: Manages the entire pipeline with error handling and retry logic [One Time Implementation]
- DataProcessor: Handles transformations and column mapping
- DatabaseWriter: Executes batch operations to Database schema tables
Sample Configuration Files
Data Sources Configuration (data-sources.yml)
# Data Sources Configuration for Database Schema
data_sources:
market_data_csv:
type: "csv"
source:
file_path: "/data/market/daily_rates.csv"
delimiter: ","
header: true
encoding: "UTF-8"
target:
schema: "MarketData"
table: "market_trends"
batch_size: 500
column_mapping:
- source: "date" → target: "trade_date"
- source: "currency_pair" → target: "currency"
- source: "rate" → target: "exchange_rate"
- source: "volume" → target: "trading_volume"
risk_metrics_excel:
type: "excel"
source:
file_path: "/data/risk/monthly_risk.xlsx"
sheet_name: "RiskData"
skip_rows: 1
target:
schema: "RiskMetrics"
table: "risk_metrics"
batch_size: 200
column_mapping:
- source: "Portfolio ID" → target: "portfolio_id"
- source: "VaR 95%" → target: "var_95"
- source: "Expected Shortfall" → target: "expected_shortfall"
- source: "Liquidity Score" → target: "liquidity_score"
validation:
required_columns: ["Portfolio ID", "VaR 95%"]
data_quality_checks: true
rest_api_data:
type: "rest_api"
source:
url: "https://api.provider.com/v1/liq"
method: "GET"
headers:
Authorization: "Bearer ${API_TOKEN}"
Content-Type: "application/json"
timeout: 30
retry_attempts: 3
target:
schema: "APIData"
table: "forecast_data"
batch_size: 1000
column_mapping:
- source: "id" → target: "id"
- source: "assetClass" → target: "asset_class"
- source: "predictedLiquidity" → target: "predicted_liquidity"
- source: "confidenceLevel" → target: "confidence_level"
- source: "forecastDate" → target: "forecast_date"
config_json:
type: "json"
source:
file_path: "/config/portfolio_settings.json"
json_path: "$.portfolios[*]"
target:
schema: "ConfigData"
table: "portfolio_config"
batch_size: 100
column_mapping:
- source: "id" → target: "portfolio_id"
- source: "name" → target: "portfolio_name"
- source: "riskProfile" → target: "risk_profile"
- source: "liquidityThreshold" → target: "liquidity_threshold"
# Global Settings
global_settings:
error_handling:
continue_on_error: true
error_threshold: 10
notification_email: "dev-team@company.com"
data_quality:
enable_validation: true
null_value_handling: "skip"
duplicate_handling: "ignore"
performance:
connection_pool_size: 10
query_timeout: 300
memory_limit: "2GB"
High Level Architecture Diagram
Class Diagram
Sequence Diagram
Key Developer Benefits
- Code Reusability: Write once, configure multiple times - no duplicate data loading logic
- Maintenance Reduction: Single codebase handles all data sources through configuration
- Easy Onboarding: New data sources added via YAML files, not code changes
- Error Handling: Built-in retry logic and comprehensive error reporting
- Performance: Batch processing and connection pooling optimize database operations
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file config_driven_data_ingestion-1.0.2.tar.gz.
File metadata
- Download URL: config_driven_data_ingestion-1.0.2.tar.gz
- Upload date:
- Size: 25.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f08cd627bdba81e28e121fa35fcba2667bb567005f429b1ce20129130f216982
|
|
| MD5 |
3eea9bff3185aba279cdfa507a5d692c
|
|
| BLAKE2b-256 |
370fecd4c3a4e7f4dc05ecbf589f53ffb7827fabaedbc789ae34884655d10a86
|
File details
Details for the file config_driven_data_ingestion-1.0.2-py3-none-any.whl.
File metadata
- Download URL: config_driven_data_ingestion-1.0.2-py3-none-any.whl
- Upload date:
- Size: 28.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47972c4cd82996a78e19d1115de202dba57ed0c6a5989a2ccdcd29df08a53061
|
|
| MD5 |
fc0ad9f20bf6c42c07aa3351d1e12ed6
|
|
| BLAKE2b-256 |
f40ce01be64e362eea02e22493d9933ecb50e462a489542527e2c070a9802850
|