vault.data_file_export
Documentation for eth_defi.vault.data_file_export Python module.
Export vault database files to Cloudflare R2.
Uploads price databases, metadata pickles, and Core3 risk intelligence DuckDB so the backtester can download them without running the full scan pipeline.
Functions
|
Build the data file list uploaded to R2. |
|
Run the data file export script. |
|
Upload a list of files to R2 bucket, excluding tmp* files. |
- get_data_file_paths(base_path, core3_db_path=None)
Build the data file list uploaded to R2.
- Parameters
base_path (pathlib.Path) – Pipeline data directory.
core3_db_path (Optional[pathlib.Path]) – Optional Core3 DuckDB path override.
- Returns
Files to upload, including optional files that may be skipped later if they do not exist.
- Return type
- main()
Run the data file export script.
Reads R2 configuration from environment variables, uploads vault data files to configured buckets, and creates daily backups in the alternative bucket when enabled.
- Return type
None
- upload_files_to_r2(file_paths, bucket_name, endpoint_url, access_key_id, secret_access_key, key_prefix='', public_url='')
Upload a list of files to R2 bucket, excluding tmp* files.
- Parameters
file_paths (list[pathlib.Path]) – List of file paths to upload.
bucket_name (str) – R2 bucket name.
endpoint_url (str) – R2 API endpoint URL.
access_key_id (str) – R2 access key ID.
secret_access_key (str) – R2 secret access key.
key_prefix (str) – Prefix for S3 keys, e.g.
test-for test uploads.public_url (str) – Public base URL for logging final download URLs.
- Returns
Number of files uploaded.
- Return type