SDK for Watcher framework
Project description
Watcher SDK
QuickStart
Installation
You can install the Watcher SDK, etl-watcher-sdk, using your preferred package manager.
Store Pipeline and Address Lineage Configuration
Store your pipeline and address lineage configuration in a Python file.
from watcher import Pipeline, PipelineConfig, AddressLineage, Address
MY_ETL_PIPELINE_CONFIG = PipelineConfig(
pipeline=Pipeline(
name="my-etl-pipeline",
pipeline_type_name="extraction",
default_watermark="2024-01-01",
),
address_lineage=AddressLineage(
source_addresses=[
Address(
name="source_db.source_schema.source_table",
address_type_name="postgres",
address_type_group_name="database",
)
],
target_addresses=[
Address(
name="target_db.target_schema.target_table",
address_type_name="snowflake",
address_type_group_name="warehouse",
)
],
),
)
Sync Pipeline and Address Lineage Configuration
Sync your pipeline and address lineage configuration to the Watcher framework. This ensures your code is the source of truth for the pipeline and address lineage configuration.
from watcher import Watcher, PipelineConfig
watcher = Watcher("https://api.watcher.example.com")
synced_config = watcher.sync_pipeline_config(MY_ETL_PIPELINE_CONFIG)
print(f"Pipeline synced!")
Track Pipeline Execution
from watcher import Watcher, PipelineConfig, ETLMetrics
watcher = Watcher("https://api.watcher.example.com")
synced_config = watcher.sync_pipeline_config(MY_ETL_PIPELINE_CONFIG)
@watcher.track_pipeline_execution(
pipeline_id=synced_config.pipeline.id,
active=synced_config.active
)
def etl_pipeline():
print("Starting ETL pipeline")
# Your ETL work here
return ETLMetrics(
inserts=100,
total_rows=100,
execution_metadata={"partition": "2025-01-01"},
)
etl_pipeline()
Contributing
I welcome contributions to the Watcher SDK! Please see the Contributing Guidelines for details on how to get started, the development process, and how to submit pull requests.
Quick Start for Contributors
- Fork the repository
- Create a feature branch
- Make your changes
- Spin up the Watcher framework for manual integration testing
- Run tests in the repo with
make test - Submit a pull request
For detailed information about the coding standards, testing requirements, and contribution process, please refer to the Contributing Guidelines.
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 etl_watcher_sdk-0.1.11.tar.gz.
File metadata
- Download URL: etl_watcher_sdk-0.1.11.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfa2ac97ab03c40b957d42f16593f0648412ed2f690c9a47959f3f2d6836dbb0
|
|
| MD5 |
d015b6ddea29907e39e0bc12cf2e4b19
|
|
| BLAKE2b-256 |
0eaf2b5ff1cc61b1b7fb19dd83e14ffb9666b843716a25195b9147e7fb3d66bb
|
File details
Details for the file etl_watcher_sdk-0.1.11-py3-none-any.whl.
File metadata
- Download URL: etl_watcher_sdk-0.1.11-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f7021d855dde8aed51089ecbe7ee6e1fef4ab35604ef9951a2ba5c47ba5f592
|
|
| MD5 |
38ab2a6467186a423c7aa10361bc7db7
|
|
| BLAKE2b-256 |
a251d095b0f4b901ddcbbba0ae54fb1db6a19bf1248f4a89c4fcf93432ab729e
|